-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly highlight selected day in date picker. #16973
Merged
Merged
Conversation
This file contains 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
linuspahl
force-pushed
the
issue-16096/date-time-picker
branch
from
October 19, 2023 06:45
7f85fbd
to
b2e6c0f
Compare
ousmaneo
approved these changes
Oct 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works. Thank you for this fix.
maxiadlovskii
approved these changes
Oct 30, 2023
linuspahl
force-pushed
the
issue-16096/date-time-picker
branch
from
October 30, 2023 14:00
db8f68a
to
9d5ea4e
Compare
linuspahl
added a commit
that referenced
this pull request
Oct 30, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
linuspahl
added a commit
that referenced
this pull request
Oct 30, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
This was referenced Oct 30, 2023
linuspahl
added a commit
that referenced
this pull request
Oct 31, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
linuspahl
added a commit
that referenced
this pull request
Oct 31, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
linuspahl
added a commit
that referenced
this pull request
Oct 31, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
dennisoelkers
pushed a commit
that referenced
this pull request
Nov 13, 2023
* Consider user timezone when displaying indicator for active date in date picker. * Use moment.utc for date time utils to make them predictable. * Fix linter hint * Adding changelog. * Updating tests. * Define time zone provided for calendar in search date picker. * Adding test * Updating prop types. * Fix typo.
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.
Please note, this PR needs a backport for
5.0
and5.1
Description
Motivation and Context
As described in #16096 the highlight for the selected date in the date picker can be wrong for a date time like
2023-10-17 00:00:00
. In this case it displayed the previous day as active.The reason is that the date time does not contain a time zone information and
moment()
still uses the estimated user time zone internally. For example when your browser timezone isEurope/Paris
the UTC time for2023-10-17 00:00:00
is2023-10-16 22:00:00
.We are now:
moment.utc()
instead ofmoment()
to make it's behaviour predictable for date times without a time zone.This only effects few cases, because usually timestamps in the frontend have a timezone.
There are more improvements we can make regarding the date time utils, but I will do them in a follow-up PR, so this PR will be easy to backport.
Fixes: #16096
Fixes: https://github.com/Graylog2/graylog-plugin-enterprise/issues/5998