- ๐ณ๐ฑ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.