Repository navigation
Timepicker step forward/backward should not overlap - #11131
Merged
Merged
Conversation
This PR fixes the step forward/backward buttons in the timepicker so that the ranges do not overlap. Prior to this PR, if you stepped forward/backward, the new range would include one millisecond of time in both ranges, which could result in documents being visible in both time ranges.
weltenwort
approved these changes
Apr 11, 2017
weltenwort
left a comment
Member
There was a problem hiding this comment.
LGTM, just left a small thought in the inline comment
| return { | ||
| from: max.toISOString(), | ||
| to: moment(max).add(diff).toISOString(), | ||
| from: moment(max).add(1).toISOString(), |
Member
There was a problem hiding this comment.
How about we add the unit 'ms' here (an in similar places) as in .add(1, 'ms') to avoid misunderstandings? The behavior of leaving out the unit is not documented even though it seems to work.
lukasolson
added a commit
that referenced
this pull request
Apr 11, 2017
* Timepicker step forward/backward should not overlap This PR fixes the step forward/backward buttons in the timepicker so that the ranges do not overlap. Prior to this PR, if you stepped forward/backward, the new range would include one millisecond of time in both ranges, which could result in documents being visible in both time ranges. * Add unit for add/subtract methods
lukasolson
added a commit
that referenced
this pull request
Apr 11, 2017
* Timepicker step forward/backward should not overlap This PR fixes the step forward/backward buttons in the timepicker so that the ranges do not overlap. Prior to this PR, if you stepped forward/backward, the new range would include one millisecond of time in both ranges, which could result in documents being visible in both time ranges. * Add unit for add/subtract methods
Contributor
Author
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
May 6, 2026
* Timepicker step forward/backward should not overlap This PR fixes the step forward/backward buttons in the timepicker so that the ranges do not overlap. Prior to this PR, if you stepped forward/backward, the new range would include one millisecond of time in both ranges, which could result in documents being visible in both time ranges. * Add unit for add/subtract methods
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 #11061.
Prior to this PR, if you used the step forward/backward buttons in the timepicker, the new range would include one millisecond from the previous range, which could result in documents showing up for both ranges.
For example, if I selected
2017-04-10T00:00:00.000Z-2017to04-10T23:59:59.999Z, then stepped backward, the new range would be2017-04-09T00:00:00.001Zto2017-04-10T00:00:00.000Z. Since the ranges are inclusive, documents that had the timestamp of exactly2017-04-10T00:00:00.000Z-2017would show up in both ranges.This PR fixes the behavior by stepping forward/backward by an extra millisecond so that the ranges do not overlap.