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
{{ message }}
Repository navigation
Timezone displays offset with decimals instead of minutes #56254
When the WordPress timezone setting is set to a time zone with minutes e.g. UTC+5:45, the actual value stored internally is a number with decimals e.g. 5.75.
There's a couple places in the editor where this value is displayed 'as is' with decimals, which is incorrect; For example, the timezone component and the post-schedule label:
At first, I tried to fix this 'locally' in the components but then I realized it would be best to fix it in the Date settings. Adding a 'display value' there would be best, so that it is available everywhere and can be used where necessary.
The relevant data are set via wp.date.setSettings() in the script loader here and then retrieved via wp.date.getSettings().
This would require a change in WP core and a compat file.
Step-by-step reproduction instructions
Go to the WordPress admin Settings > General Settings > Timezone.
Set the Timezone value to UTC+5:45 and save.
Go to the post editor and publish a new post.
Click the Publish date in the settings panel.
Observe that both the Publish date and the timezone indication in the Publish popover display UTC+5.75.
Expected: UTC+5:45
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Besides the cases where timezone.offset is used for display purposes, there may be other cases where the value is used internally. I'd appreciate some help with double checking all the potential cases that may be impacted.
Activity
afercia commentedon Nov 17, 2023
Besides the cases where
timezone.offsetis used for display purposes, there may be other cases where the value is used internally. I'd appreciate some help with double checking all the potential cases that may be impacted.