-
Notifications
You must be signed in to change notification settings - Fork 79
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
Schedule block shows dates 1 day in the past #559
Comments
I've been investigating this and I think it has to do with timezones, but I'm not totally sure about the logic why.
I've switched https://colombia.wordcamp.org/2020/ to use the UTC offset directly (under Ajustes -> Generales -> Zona horaria), and that fixes everything above - the headings are correct now, and the session times are correct for the site visitor too, showing the real time of the session in their local timezone. I think this issue comes back to flakey support for string timezones, WordPress/gutenberg#22193. Switching sites to UTC offsets is not a good long term solution, but works for now. I'm going to leave this open to track the WordCamp side of things, but it's likely date changes are needed on the WP core side. |
@ryelle: Thanks for looking into this. I didn't think my timezone would make a difference but what you said above makes sense and explains why I was seeing "Sept 9" (as the site's UTC-5 but I'm in UTC-3). I'm glad there's at least a workaround and that switching to UTC, while not ideal, fixes the issues. 🙇 |
WordPress/gutenberg#25078 and WordPress/gutenberg#22193 alone aren't enough to fix this. After those are installed, though, we can work around this by replacing the - { dateI18n( settings.date_format, date ) }
+ { dateI18n( settings.date_format, sessions[0].derived.startTime ) } There's 1 other place in the function that needs a similar change, and possibly a few others throughout the block's code. |
These dates are _already_ in the site timezone, so `dateI18n()` et al would add the UTC offset a _second_ time. In some cases that would cross a date boundary, and the wrong date would be displayed. Fixes #559
Er, nevermind, I think the proper solution here is to use |
These dates are _already_ in the site timezone, so `dateI18n()` et al would add the UTC offset a _second_ time. In some cases that would cross a date boundary, and the wrong date would be displayed. Fixes #559
These dates are _already_ in the site timezone, so `dateI18n()` et al would add the UTC offset a _second_ time. In some cases that would cross a date boundary, and the wrong date would be displayed. Fixes #559
Describe the bug
We're using the schedule block on our site, but dates inside this block appear to be 1 day in the past. For instance, our sessions are on Sept 10, 11 and 12, but the schedule block displays them as being on Sept 09, 10 and 11.
The site timezone is correctly configured.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Session time in session posts should match what the schedule block displays.
Screenshots
WordCamp
https://colombia.wordcamp.org/2020/
System (please complete the following information):
The text was updated successfully, but these errors were encountered: