- 🇳🇱Netherlands johnv
The patch still is valid on D11.1
The problem occurs and is solved in both cases: with Date filter 'date' option and with 'offset' option. Updating summary.
A test is added, but #20 is still relevant. - First commit to issue fork.
- Merge request !11228added the current timestamp to offsets for twice the same day issue → (Open) created by Unnamed author
- 🇮🇳India niranjan_panem Gurugram
checked the issue, still exists. Created a patch below is that it contains current timestamp added to offsets to resolve the offset issue.
→ - First commit to issue fork.
MR in #28 didn’t fix the actual issue where, if the same date is provided in the filter, it won’t filter the full day as expected.
As the problem lies in:
- For offset type with identical min and max (e.g., +1 day):
-
$a = '***CURRENT_TIME***+86400', $b = '***CURRENT_TIME***+86400'
.
- Query: $field
BETWEEN ***CURRENT_TIME***+86400 AND ***CURRENT_TIME***+86400
.
- Matches only the exact timestamp, not the full day, often yielding no results.
- For date type, with identical min and max (e.g., 2025-03-03):
- Both $a and $b will be same 2025-03-03 00:00:00 with no result
Solution:
- Offset Type:
- Add check:
if ($this->value['min'] === $this->value['max'] && $b_original % 86400 === 0).
- Adjust
$b
to end of day(offset_days * 86400 + 86399)
. - Retains behavior for offsets with time (e.g.,
+1 day 4 hours)
. - Date Type:
- Add check:
(date('H:i:s', strtotime($this->value['max'])) == '00:00:00').
- Adjust
$b
to end of the day23:59:59
Added test for edge cases mentioned in #20.
- Status changed to Needs review
4 months ago 7:19pm 17 April 2025 The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
@Lendude I’ve updated the logic so that the “end of day” adjustment is applied only when the min and max values are on the same calendar date.
This fixes the issue in existing Views where the “until” filter was returning an extra day’s results.However, this change introduces a new scenario:
- A filter with
min date = 2025-08-08
andmax date = 2025-08-08
will now return the same results asmin date = 2025-08-08
andmax date = 2025-08-09
, since both cases include the entire day of 2025-08-08.
Another solution I'm thinking for the issue is to remove this logic entirely and simply validate that the max value must always be greater than the min value, either by time offset or by date, to avoid identical results for different ranges.
What are your thoughts on this?
- A filter with