Make WordPress Core


Ignore:
Timestamp:
11/06/2015 04:33:52 PM (10 years ago)
Author:
SergeyBiryukov
Message:

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

Props tyxla.
Fixes #34602.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r35497 r35555  
    28452845            $days = 1;
    28462846        $since = sprintf( _n( '%s day', '%s days', $days ), $days );
    2847     } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
     2847    } elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
    28482848        $weeks = round( $diff / WEEK_IN_SECONDS );
    28492849        if ( $weeks <= 1 )
    28502850            $weeks = 1;
    28512851        $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
    2852     } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
    2853         $months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
     2852    } elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
     2853        $months = round( $diff / MONTH_IN_SECONDS );
    28542854        if ( $months <= 1 )
    28552855            $months = 1;
Note: See TracChangeset for help on using the changeset viewer.