From 207ab0db7db9936eb542c09027aacbfb81d1a673 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 6 Nov 2015 16:33:52 +0000 Subject: [PATCH] Use the `MONTH_IN_SECONDS` constant added in [33698] for the month representation in `human_time_diff()` logic. Props tyxla. Fixes #34602. git-svn-id: https://develop.svn.wordpress.org/trunk@35555 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 71c5b04f0c..abbb090612 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -2844,13 +2844,13 @@ function human_time_diff( $from, $to = '' ) { if ( $days <= 1 ) $days = 1; $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 ); if ( $weeks <= 1 ) $weeks = 1; $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks ); - } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) { - $months = round( $diff / ( 30 * DAY_IN_SECONDS ) ); + } elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) { + $months = round( $diff / MONTH_IN_SECONDS ); if ( $months <= 1 ) $months = 1; $since = sprintf( _n( '%s month', '%s months', $months ), $months );