From b95580d5eda48409bd6f98afd7ed0f22c73a3290 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 17 Nov 2013 03:29:11 +0000 Subject: [PATCH] Fix date comparison in dashboard_relative_date(). fixes #26033. git-svn-id: https://develop.svn.wordpress.org/trunk@26242 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/dashboard.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 6cd81af5f9..0aef77d938 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/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);