Handle time_diff less than a minute http://mosquito.wordpress.org/view.php?id=737
git-svn-id: http://svn.automattic.com/wordpress/trunk@2124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
37c1aa422d
commit
3e1ff77a0e
|
@ -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…
Reference in New Issue