mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Script Loader: Add a timezone offset display value to wp.date.setSettings.
Fixes a bug in the editor where the offset values are displayed as decimals rather than minutes. Props afercia, get_dave. Fixes #60105. git-svn-id: https://develop.svn.wordpress.org/trunk@57556 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
50af5dbed1
commit
9da53b8b49
@ -419,6 +419,8 @@ function wp_default_packages_inline_scripts( $scripts ) {
|
||||
$timezone_abbr = $timezone_date->format( 'T' );
|
||||
}
|
||||
|
||||
$gmt_offset = get_option( 'gmt_offset', 0 );
|
||||
|
||||
$scripts->add_inline_script(
|
||||
'wp-date',
|
||||
sprintf(
|
||||
@ -475,9 +477,10 @@ function wp_default_packages_inline_scripts( $scripts ) {
|
||||
'datetimeAbbreviated' => __( 'M j, Y g:i a' ),
|
||||
),
|
||||
'timezone' => array(
|
||||
'offset' => (float) get_option( 'gmt_offset', 0 ),
|
||||
'string' => $timezone_string,
|
||||
'abbr' => $timezone_abbr,
|
||||
'offset' => (float) $gmt_offset,
|
||||
'offsetFormatted' => str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), (string) $gmt_offset ),
|
||||
'string' => $timezone_string,
|
||||
'abbr' => $timezone_abbr,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user