File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,16 @@ class PostSchedule extends Component {
4848 const handleChange = ( newDate ) => {
4949 onUpdateDate ( newDate . format ( 'YYYY-MM-DDTHH:mm:ss' ) ) ;
5050 } ;
51- const is12HourTime = settings . formats . time . indexOf ( 'a' ) !== - 1 || settings . formats . time . indexOf ( 'A' ) !== - 1 ;
51+
52+ // To know if the current timezone is a 12 hour time with look for "a" in the time format
53+ // We also make sure this a is not escaped by a "/"
54+ const is12HourTime = / a (? ! \\ ) / i. test (
55+ settings . formats . time
56+ . toLowerCase ( ) // Test only the lower case a
57+ . replace ( / \\ \\ / g, '' ) // Replace "//" with empty strings
58+ . split ( '' ) . reverse ( ) . join ( '' ) // Reverse the string and test for "a" not followed by a slash
59+ ) ;
60+
5261 return (
5362 < div className = "editor-post-schedule" >
5463 < span > { __ ( 'Publish' ) } </ span >
Original file line number Diff line number Diff line change 9090.wp-core-ui .editor-post-schedule__clock-am-button.is-toggled ,
9191.wp-core-ui .editor-post-schedule__clock-pm-button.is-toggled {
9292 background : $light-gray-300 ;
93- border-color : $dark-gray-100 ;
93+ border-color : $dark-gray-100 ;
9494 box-shadow : inset 0 2px 5px -3px $dark-gray-500 ;
9595 transform : translateY (1px );
9696}
You can’t perform that action at this time.
0 commit comments