Use the `MONTH_IN_SECONDS` constant added in [33698] for the month representation in `human_time_diff()` logic.

Props tyxla.
Fixes #34602.
Built from https://develop.svn.wordpress.org/trunk@35555


git-svn-id: http://core.svn.wordpress.org/trunk@35519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-11-06 16:34:26 +00:00
parent 7ad65267b6
commit 5f16d19be7
2 changed files with 4 additions and 4 deletions

View File

@ -2844,13 +2844,13 @@ function human_time_diff( $from, $to = '' ) {
if ( $days <= 1 ) if ( $days <= 1 )
$days = 1; $days = 1;
$since = sprintf( _n( '%s day', '%s days', $days ), $days ); $since = sprintf( _n( '%s day', '%s days', $days ), $days );
} elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) { } elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
$weeks = round( $diff / WEEK_IN_SECONDS ); $weeks = round( $diff / WEEK_IN_SECONDS );
if ( $weeks <= 1 ) if ( $weeks <= 1 )
$weeks = 1; $weeks = 1;
$since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks ); $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
} elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) { } elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
$months = round( $diff / ( 30 * DAY_IN_SECONDS ) ); $months = round( $diff / MONTH_IN_SECONDS );
if ( $months <= 1 ) if ( $months <= 1 )
$months = 1; $months = 1;
$since = sprintf( _n( '%s month', '%s months', $months ), $months ); $since = sprintf( _n( '%s month', '%s months', $months ), $months );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-beta3-35554'; $wp_version = '4.4-beta3-35555';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.