[EuiSuperDatePicker] Prevent time window steps from drifting by 1ms#9434
Merged
mgadewoll merged 3 commits intoelastic:mainfrom Mar 13, 2026
Merged
Conversation
weronikaolejniczak
approved these changes
Mar 12, 2026
Collaborator
💚 Build SucceededHistory
cc @mgadewoll |
Collaborator
💚 Build Succeeded
cc @mgadewoll |
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.




Summary
This PR updates
EuiSuperDatePickerto fix unexpected time shifts by1mswhen using the time window buttons.The issue was that the
roundUpondateMath.parse({date}, { roundUp: true })results in.999mstimes for relative dates like "Today". This results in a1msdifference that's being carried across time window steps.This update ensures that the time window range is adjusted accordingly for "inclusive" dates (ending on the last ms of the date instead of the first ms of the next date) to keep a stable ms range.
Note
A similar issue was previously resolved for absolute dates in #8985.
Why are we making this change?
🧰 Bug fix: This bug was reported to us by @KodeRad. This update ensures that the time window steps result in stable start and end date/time.
Screenshots #
Screen.Recording.2026-03-09.at.15.11.09.mov
Screen.Recording.2026-03-09.at.15.12.53.mov
Screen.Recording.2026-03-09.at.15.10.36.mov
Screen.Recording.2026-03-09.at.15.13.34.mov
Screen.Recording.2026-03-09.at.15.11.37.mov
Screen.Recording.2026-03-09.at.15.14.04.mov
Screen.Recording.2026-03-09.at.15.24.35.mov
Screen.Recording.2026-03-09.at.15.25.26.mov
Impact to users
🟢 No updates required on consumer side.
QA
00:00:00.000 - 23:59:59.999EuiSuperDatePickertime windows results in the same range of00:00:00.000 - 23:59:59.999for the previous day(s)EuiSuperDatePickertime windows results in the same range of00:00:00.000 - 23:59:59.999for the previous day(s).000msand end.999msrangesGeneral checklist
@defaultif default values are missing) and playground toggles