Publish box: fix strange date format after change

Part props tyxla.
Fixes #30716.


git-svn-id: https://develop.svn.wordpress.org/trunk@33340 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ella Iseulde Van Dorpe 2015-07-21 11:39:20 +00:00
parent 810ace4a5e
commit bcb2d6d0db
3 changed files with 8 additions and 6 deletions

View File

@ -784,9 +784,10 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$month = '<label><span class="screen-reader-text">' . __( 'Month' ) . '</span><select ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
for ( $i = 1; $i < 13; $i = $i +1 ) {
$monthnum = zeroise($i, 2);
$month .= "\t\t\t" . '<option value="' . $monthnum . '" ' . selected( $monthnum, $mm, false ) . '>';
$monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
$month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum, $mm, false ) . '>';
/* translators: 1: month number (01, 02, etc.), 2: month abbreviation */
$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) ) . "</option>\n";
$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . "</option>\n";
}
$month .= '</select></label>';
@ -797,7 +798,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
echo '<div class="timestamp-wrap">';
/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
printf( __( '%1$s %2$s, %3$s @ %4$s : %5$s' ), $month, $day, $year, $hour, $minute );
printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';

View File

@ -558,8 +558,9 @@ jQuery(document).ready( function($) {
$('#timestamp').html(stamp);
} else {
$('#timestamp').html(
publishOn + ' <b>' +
postL10n.dateFormat.replace( '%1$s', $('option[value="' + $('#mm').val() + '"]', '#mm').text() )
'\n' + publishOn + ' <b>' +
postL10n.dateFormat
.replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
.replace( '%2$s', jj )
.replace( '%3$s', aa )
.replace( '%4$s', hh )

View File

@ -487,7 +487,7 @@ function wp_default_scripts( &$scripts ) {
'publishOnFuture' => __('Schedule for:'),
'publishOnPast' => __('Published on:'),
/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
'dateFormat' => __('%1$s %2$s, %3$s @ %4$s : %5$s'),
'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s'),
'showcomm' => __('Show more comments'),
'endcomm' => __('No more comments found.'),
'publish' => __('Publish'),