mirror of https://gitee.com/karson/fastadmin.git
Pre Merge pull request !203 from 寂静心欢喜/f
commit
3cce5191bc
|
|
@ -111,6 +111,15 @@ return [
|
||||||
'%d week%s ago' => '%d周前',
|
'%d week%s ago' => '%d周前',
|
||||||
'%d month%s ago' => '%d月前',
|
'%d month%s ago' => '%d月前',
|
||||||
'%d year%s ago' => '%d年前',
|
'%d year%s ago' => '%d年前',
|
||||||
|
//
|
||||||
|
'%d second%s after' => '%d秒后',
|
||||||
|
'%d minute%s after' => '%d分钟后',
|
||||||
|
'%d hour%s after' => '%d小时后',
|
||||||
|
'%d day%s after' => '%d天后',
|
||||||
|
'%d week%s after' => '%d周后',
|
||||||
|
'%d month%s after' => '%d月后',
|
||||||
|
'%d year%s after' => '%d年后',
|
||||||
|
//
|
||||||
'Set to normal' => '设为正常',
|
'Set to normal' => '设为正常',
|
||||||
'Set to hidden' => '设为隐藏',
|
'Set to hidden' => '设为隐藏',
|
||||||
'Recycle bin' => '回收站',
|
'Recycle bin' => '回收站',
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,9 @@ class Date
|
||||||
*/
|
*/
|
||||||
public static function human($remote, $local = null)
|
public static function human($remote, $local = null)
|
||||||
{
|
{
|
||||||
$timediff = (is_null($local) || $local ? time() : $local) - $remote;
|
$local = is_null($local) || $local ? time() : $local;
|
||||||
|
$type = ($remote > $local) ? 'after' : 'ago';
|
||||||
|
$timediff = abs($local - $remote);
|
||||||
$chunks = array(
|
$chunks = array(
|
||||||
array(60 * 60 * 24 * 365, 'year'),
|
array(60 * 60 * 24 * 365, 'year'),
|
||||||
array(60 * 60 * 24 * 30, 'month'),
|
array(60 * 60 * 24 * 30, 'month'),
|
||||||
|
|
@ -142,7 +144,7 @@ class Date
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return __("%d {$name}%s ago", $count, ($count > 1 ? 's' : ''));
|
return __("%d {$name}%s {$type}", $count, ($count > 1 ? 's' : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue