WordPress.org

Make WordPress Core

Ticket #26502: 26502-alt.diff

File 26502-alt.diff, 798 bytes (added by GaryJ, 6 years ago)

Show year if timestamp has different year to now.

  • wp-admin/includes/dashboard.php

     
    593593                                $relative = __( 'Today' );
    594594                        } elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
    595595                                $relative = __( 'Tomorrow' );
     596                        } elseif ( date( 'Y', $time ) !== date( 'Y', current_time( 'timestamp' ) ) ) {
     597                                /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see http://php.net/date */
     598                                $relative = date_i18n( __( 'M jS Y' ), $time );
    596599                        } else {
    597600                                /* translators: date and time format for recent posts on the dashboard, see http://php.net/date */
    598601                                $relative = date_i18n( __( 'M jS' ), $time );