-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add a timezone offset value for display purposes #56682
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/script-loader.php ❔ lib/load.php |
Size Change: +13 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
I'll remove myself as a review as this isn't really my domain. Instead, I'm adding a few more folks (following suggestions from GitHub) who may be better suited to take a good look |
@Mamaduka hi. Any familiarity with compat files? When you have a chance, some help would be greatly appreciated 🙏 |
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.
@afercia, I wonder if we should just do the conversion on the client side since the human-readable offset is only used when displaying the text. The libraries on the client and server can accept unformatted values.
P.S. The new compat file looks good to me. There's already a gutenberg_update_wp_date_settings
filter in WP 6.4; we should probably remove it to avoid double filtering.
6912663
to
6df0c78
Compare
@Mamaduka thanks for your review.
Yes that's an option. I'd think it's simpler to just provide the value and use it directly. Otherwise we should make the conversion in two different places or provide a small utility and use it in two places anyways. And in the tests.
I have no idea how the compat files mechanism works. Glad to remove it if necessary, just let me know. |
79abf23
to
604a89f
Compare
604a89f
to
47bb3e5
Compare
47bb3e5
to
781b916
Compare
Rebased on top of latest trunk. |
Thank you for working on this and the associated backport to WP Core. I added it to the PHP Sync Tracking Issue. Once the code is merged into WP Core we'd be grateful if you could:
Thank you in advance 🙇 |
Trac ticket for Core patch: https://core.trac.wordpress.org/ticket/60105 🙇🏻 |
Fixes #56254
I'm not very familiar with how to handle compat files. This is only a first pass to showcase a possible solution, please do not merge yet.
What?
The timezone offset value is displayed 'as is stored' with decimals instead of minutes. E.g.
5.75
instead of5.45
.As such, the stored value is not what we want for display purposes.
Why?
We need to display a correct timezone with minutes.
How?
wp.date.setSettings
.formattedOffset
to thetimezone
settings, this new value is meant for display purposes.Testing Instructions
UTC+5:45
.Testing Instructions for Keyboard
Screenshots or screencast