Pre Merge pull request !481 from 一半/develop

pull/481/MERGE
一半 2025-01-01 23:53:36 +00:00 committed by Gitee
commit b88dfae4c7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ class Date
*/ */
public static function human($remote, $local = null) public static function human($remote, $local = null)
{ {
$time_diff = (is_null($local) || $local ? time() : $local) - $remote; $time_diff = (is_null($local) ? time() : $local) - $remote;
$tense = $time_diff < 0 ? 'after' : 'ago'; $tense = $time_diff < 0 ? 'after' : 'ago';
$time_diff = abs($time_diff); $time_diff = abs($time_diff);
$chunks = [ $chunks = [
@ -146,7 +146,7 @@ class Date
break; break;
} }
} }
return __("%d $name%s $tense", $count, ($count > 1 ? 's' : '')); return __("%d $name%s $tense", [$count, ($count > 1 ? 's' : '')]);
} }
/** /**