Fix date comparison in dashboard_relative_date(). fixes #26033.
Built from https://develop.svn.wordpress.org/trunk@26242 git-svn-id: http://core.svn.wordpress.org/trunk@26149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ecd594b5a6
commit
35ec8405f0
|
@ -633,12 +633,13 @@ function dashboard_comments( $total_items = 5 ) {
|
|||
*/
|
||||
function dashboard_relative_date( $time ) {
|
||||
|
||||
$diff = floor( ( $time - time() ) / DAY_IN_SECONDS );
|
||||
$today = date( 'Y-m-d', current_time( 'timestamp' ) );
|
||||
$tomorrow = date( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );
|
||||
|
||||
if ( $diff == 0 )
|
||||
if ( date( 'Y-m-d', $time ) == $today )
|
||||
return __( 'Today' );
|
||||
|
||||
if ( $diff == 1 )
|
||||
if ( date( 'Y-m-d', $time ) == $tomorrow )
|
||||
return __( 'Tomorrow' );
|
||||
|
||||
return date( 'M jS', $time);
|
||||
|
|
Loading…
Reference in New Issue