Opened 3 years ago
Closed 3 years ago
#60105 closed defect (bug) (fixed)
Add a timezone offset display value to wp.date.setSettings
| Reported by: | afercia | Owned by: | youknowriad |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.5 |
| Component: | Script Loader | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
3 years ago
- Summary Add a timezone offset display value to `wp.date.setSettings` → Add a timezone offset display value to wp.date.setSettings
#3
follow-up:
↓ 5
@
3 years 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
@
3 years 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.setSettingsin thescript-loader.phpfile. 60105.diff just does that.