Opened 9 months ago
Closed 7 months ago
#60105 closed defect (bug) (fixed)
Add a timezone offset display value to wp.date.setSettings
Reported by: | afercia | Owned by: | youknowriad |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Script Loader | Keywords: | has-patch |
Focuses: | Cc: |
Description
In https://github.com/WordPress/gutenberg/pull/56682 I'm proposing to add a timezone offset value for displaying purposes, to be used in the Gutenberg editor.
Right now, the editor is displaying the stored value which is a float number with decimals. For some timezone offsets, that displays incorrect values in the UI like 5:75
instead of 5:45
.
There's already a couple places in Core where such a conversion is in place for displaying purposes:
- In the select element for the Timezone setting.
- In the customizer WP_Customize_Date_Time_Control class.
It would be a one line addition:
'offsetFormatted' => str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), (string) get_option( 'gmt_offset', 0 ),
Attachments (1)
Change History (7)
#1
@
9 months ago
- Summary changed from Add a timezone offset display value to `wp.date.setSettings` to Add a timezone offset display value to wp.date.setSettings
#3
follow-up:
↓ 5
@
8 months ago
As a follow-up to the changes in Gutenberg, a few translators comments have been improved in https://github.com/WordPress/gutenberg/pull/58488. It would be good to improve the ones in Core as well.
#5
in reply to:
↑ 3
@
8 months ago
Replying to afercia:
As a follow-up to the changes in Gutenberg, a few translators comments have been improved in https://github.com/WordPress/gutenberg/pull/58488. It would be good to improve the ones in Core as well.
Oh I see the translators comments are already tracked at #60412
https://github.com/WordPress/gutenberg/pull/56682 has been merged in the Gutenberg repository. As such, those changes need to be ported to the Core
wp.date.setSettings
in thescript-loader.php
file. 60105.diff just does that.