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"; $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 ) { for ( $i = 1; $i < 13; $i = $i +1 ) {
$monthnum = zeroise($i, 2); $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 */ /* 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>'; $month .= '</select></label>';

View File

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