You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DatePicker calendar displays wrong date labels for users in UK when the website is in US tz.
All Day's labels are shifted by 1 back. Doing the debug - found that the issue happen because of two libs (date-fns and moment.js) used in Gutenberg works differently with Day Saving Time switches. The date-fns is used for defining start of week, month etc. when moment is used as main lib to works with dates.
So when getting calendar array with dates from date-fns - the calendar contain dates in different timezones before and after DTS. So moment.js don't care about it and think it's in the same timezone.
This is similar issue to #56844 and #47698
Step-by-step reproduction instructions
Set local UK timezone
Set website US timezone (America/New_York)
Go to post with Gutenberg enabled
Open the post date picker
find the October 2024 and November 2024
Check the day's labels
Screenshots, screen recording, code snippet
Screen.Recording.2024-12-02.at.14.34.07.mov
Environment info
WP 6.5, default Gutenberg version for this WP version (Also checked on the 6.7.1, 6.6.2)
Chrome Version 130.0.6723.70 (Official Build) (x86_64)
Mac OS 14.5 (23F79)
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
Please confirm which theme type you used for testing.
Description
The DatePicker calendar displays wrong date labels for users in UK when the website is in US tz.
All Day's labels are shifted by 1 back. Doing the debug - found that the issue happen because of two libs (date-fns and moment.js) used in Gutenberg works differently with Day Saving Time switches. The date-fns is used for defining start of week, month etc. when moment is used as main lib to works with dates.
So when getting calendar array with dates from date-fns - the calendar contain dates in different timezones before and after DTS. So moment.js don't care about it and think it's in the same timezone.
This is similar issue to #56844 and #47698
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Screen.Recording.2024-12-02.at.14.34.07.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.