Handle time_diff less than a minute http://mosquito.wordpress.org/view.php?id=737
git-svn-id: https://develop.svn.wordpress.org/trunk@2124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f03cf45758
commit
a42aac1345
@ -620,7 +620,10 @@ function human_time_diff( $from, $to = '' ) {
|
||||
$diff = (int) ($to - $from);
|
||||
if ($diff <= 3600) {
|
||||
$mins = round($diff / 60);
|
||||
$since = sprintf( __('%s mins'), $mins);
|
||||
if ($mins <= 1)
|
||||
$since = __('1 min');
|
||||
else
|
||||
$since = sprintf( __('%s mins'), $mins);
|
||||
} else if (($diff <= 86400) && ($diff > 3600)) {
|
||||
$hours = round($diff / 3600);
|
||||
if ($hours <= 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user