fix: update dateMin and dateMax to accept string or integer formats and enhance validation logic - #3659
Open
Chartman123 wants to merge 3 commits into
Open
fix: update dateMin and dateMax to accept string or integer formats and enhance validation logic#3659Chartman123 wants to merge 3 commits into
Chartman123 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…nd enhance validation logic Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
Chartman123
force-pushed
the
fix/date-limits
branch
from
September 13, 2026 21:10
9c7c64e to
76215a3
Compare
Chartman123
marked this pull request as ready for review
September 13, 2026 21:39
samin-z
reviewed
Sep 14, 2026
| || (isset($extraSettings['timeMax']) && $d > DateTime::createFromFormat($format, $extraSettings['timeMax'])) | ||
| $dateMin = isset($extraSettings['dateMin']) | ||
| ? (is_int($extraSettings['dateMin']) | ||
| ? (new DateTime())->setTimestamp($extraSettings['dateMin'])->setTime(0, 0, 0) |
Collaborator
There was a problem hiding this comment.
*** can be fixed in the future but quick mention:
old timestamp limits can still pick the wrong calendar day because of timezone (server vs browser). when reading legacy int, turn it into a 'Y-m-d' string first and then use the same string comparison path as the new limits instead of 'setTimestamp()->setTime(0, 0, 0)', something like:
$dateMin = (new \DateTime('@' . $extraSettings['dateMin']))
->setTimezone(new \DateTimeZone('UTC'))
->format('Y-m-d');
$dateMin = \DateTime::createFromFormat('!Y-m-d', $dateMin);
| : null; | ||
| $dateMax = isset($extraSettings['dateMax']) | ||
| ? (is_int($extraSettings['dateMax']) | ||
| ? (new DateTime())->setTimestamp($extraSettings['dateMax'])->setTime(0, 0, 0) |
Chartman123
force-pushed
the
fix/date-limits
branch
from
September 14, 2026 17:58
23da438 to
ca9f258
Compare
…rmats and enhance validation logic Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
Chartman123
force-pushed
the
fix/date-limits
branch
from
September 14, 2026 18:05
793bf62 to
aac815b
Compare
…eger formats and enhance validation logic Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3617 by making the validation of date limits timezone-independent
🤖 AI (if applicable)