Skip to content
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

DateTimePicker Displays an Incorrect Calendar if the user's timezone is vastly different from the WordPress one. #47698

Closed
cadwell opened this issue Feb 2, 2023 · 3 comments · Fixed by #47879
Labels
[Package] Date /packages/date [Type] Bug An existing feature does not function as intended

Comments

@cadwell
Copy link

cadwell commented Feb 2, 2023

Description

When the user's timezone is significantly different than the timezone that WordPress is configured with, the DateTimePicker component displays incorrectly. The first day of the month that is being displayed is the last day of the previous month. This causes some days within the month to disappear.

Similar issue to #29306 however this targets the month's display.

Step-by-step reproduction instructions

  1. Change your local machine's timezone to somewhere in England.
  2. Set WordPress's timezone setting to Los Angeles.
  3. Edit or Add a new post.
  4. Open the DateTimePicker component by trying to schedule a post.

Screenshots, screen recording, code snippet

image

Environment info

  • WordPress Version 6.1.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@chiltonreaktiv
Copy link

@cadwell I have experienced this issue as well. I was able to reproduce this bug.

@kathrynwp kathrynwp added [Type] Bug An existing feature does not function as intended [Package] Date /packages/date labels Feb 2, 2023
@wojtekn
Copy link
Contributor

wojtekn commented Feb 8, 2023

Possible fix: #47879

@singhpaul
Copy link

singhpaul commented Feb 2, 2024

Issue was not resolved by #47879 or there has been a regression because we're able to replicate reliably with the steps outlined by @cadwell above.

The following screenshot was taken at UTC Feb 2, 2024 @ 2:04 AM. WP and server are both set to New York TZ and the local machine to London TZ. Jan 31 is displayed erroneously, Feb 29 is missing and the current month is mislabeled as January.

Screenshot 2024-02-02 at 2 05 15 AM

This also has functional implications because the date display offset yields the peculiar behavior that clicking on a date in the calendar updates the form input field date to the next date. So clicking on Feb 7 updates the form input field to Feb 8, as seen here:

Screenshot 2024-02-02 at 2 14 10 AM

As @cadwell mentioned, issue seems related to #29306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Date /packages/date [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants