Fix date comparison in dashboard_relative_date(). fixes #26033.

git-svn-id: https://develop.svn.wordpress.org/trunk@26242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-11-17 03:29:11 +00:00
parent dfd8f30724
commit b95580d5ed
1 changed files with 4 additions and 3 deletions

View File

@ -633,12 +633,13 @@ function dashboard_comments( $total_items = 5 ) {
*/ */
function dashboard_relative_date( $time ) { 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' ); return __( 'Today' );
if ( $diff == 1 ) if ( date( 'Y-m-d', $time ) == $tomorrow )
return __( 'Tomorrow' ); return __( 'Tomorrow' );
return date( 'M jS', $time); return date( 'M jS', $time);