Make WordPress Core

Ticket #30716: 30716.patch

File 30716.patch, 2.4 KB (added by tyxla, 9 years ago)

Fixing the differences issue by: removing spaces around the colon between hour and minutes in date format; removing the dd- prefix (and possible spaces) before the month name; removing the zeroisation of the month day; zeroizing the minutes. This will basically make the dates before updating and after updating to use the exactly same format.

  • src/wp-admin/includes/template.php

     
    763763
    764764        echo '<div class="timestamp-wrap">';
    765765        /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    766         printf( __( '%1$s %2$s, %3$s @ %4$s : %5$s' ), $month, $day, $year, $hour, $minute );
     766        printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
    767767
    768768        echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
    769769
  • src/wp-admin/js/post.js

     
    676676                stamp = $('#timestamp').html();
    677677                visibility = $('#post-visibility-display').html();
    678678
     679                zeroise = function(number) {
     680                        var str = number.toString();
     681
     682                        if ( str.length < 2 ) {
     683                                str = '0' + str;
     684                        }
     685
     686                        return str;
     687                };
     688
    679689                updateVisibility = function() {
    680690                        if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
    681691                                $('#sticky').prop('checked', false);
     
    725735                        } else {
    726736                                $('#timestamp').html(
    727737                                        publishOn + ' <b>' +
    728                                         postL10n.dateFormat.replace( '%1$s', $('option[value="' + $('#mm').val() + '"]', '#mm').text() )
    729                                                 .replace( '%2$s', jj )
     738                                        postL10n.dateFormat.replace( '%1$s', $('option[value="' + $('#mm').val() + '"]', '#mm').text().replace(/[\d\-\s]+/, '') )
     739                                                .replace( '%2$s', jj.replace(/^0/, '') )
    730740                                                .replace( '%3$s', aa )
    731741                                                .replace( '%4$s', hh )
    732                                                 .replace( '%5$s', mn ) +
     742                                                .replace( '%5$s', zeroise( mn ) ) +
    733743                                                '</b> '
    734744                                );
    735745                        }
  • src/wp-includes/script-loader.php

     
    446446                        'publishOnFuture' =>  __('Schedule for:'),
    447447                        'publishOnPast' => __('Published on:'),
    448448                        /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
    449                         'dateFormat' => __('%1$s %2$s, %3$s @ %4$s : %5$s'),
     449                        'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s'),
    450450                        'showcomm' => __('Show more comments'),
    451451                        'endcomm' => __('No more comments found.'),
    452452                        'publish' => __('Publish'),