Skip to content

Commit 5411acf

Browse files
committed
[Grid] Fix system.datetime filter never matching non-midnight values
DateTimeFilter::apply passed roundToDay=false to applySystemDatetimeFilter, which makes GDI's DateFilter collapse gte and lte to the same instant for "on" queries — and similarly turn from/to into exact instant boundaries. The filter UI exposes only a date picker (no time), so an exact-instant match here never succeeds for stored datetime values whose time component is non-zero. DateFilter (system.date) already passes roundToDay=true; DateTimeFilter should too.
1 parent 94630f5 commit 5411acf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/DataIndex/Filter/DateTimeFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ public function apply(mixed $parameters, QueryInterface $query): QueryInterface
3232
return $query;
3333
}
3434

35+
// The filter UI is date-only, so "on" / range queries are always whole-day matches.
36+
// Without rounding, GDI's DateFilter collapses gte/lte to the same instant and never
37+
// matches stored datetimes with a non-zero time component.
3538
foreach ($parameters->getColumnFilterByType(ColumnType::SYSTEM_DATETIME->value) as $column) {
36-
$query = $this->applySystemDatetimeFilter($column, $query, false);
39+
$query = $this->applySystemDatetimeFilter($column, $query, true);
3740
}
3841

3942
return $query;

0 commit comments

Comments
 (0)