From 35ec8405f033d7e60ed9782383abece109d0f428 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Nov 2013 03:30:09 +0000 Subject: [PATCH] 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 --- wp-admin/includes/dashboard.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 6cd81af5f9..0aef77d938 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -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);