mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Revert "Revert "Mark date and time format translatable""
This reverts commit 24a025becb
.
This commit is contained in:
parent
24a025becb
commit
47cb5d3cc3
1 changed files with 6 additions and 6 deletions
|
@ -54,21 +54,21 @@ function phabricator_time($epoch, $user) {
|
||||||
return phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
'g:i A');
|
pht('g:i A'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function phabricator_datetime($epoch, $user) {
|
function phabricator_datetime($epoch, $user) {
|
||||||
return phabricator_format_local_time(
|
return phabricator_format_local_time(
|
||||||
$epoch,
|
$epoch,
|
||||||
$user,
|
$user,
|
||||||
_phabricator_date_format($epoch).', g:i A');
|
pht('%s, g:i A', _phabricator_date_format($epoch)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function _phabricator_date_format($epoch) {
|
function _phabricator_date_format($epoch) {
|
||||||
$format = 'M j Y';
|
$format = pht('M j Y');
|
||||||
$now = time();
|
$now = time();
|
||||||
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
|
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
|
||||||
$format = 'D, M j';
|
$format = pht('D, M j');
|
||||||
}
|
}
|
||||||
return $format;
|
return $format;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ function phabricator_format_local_time($epoch, $user, $format) {
|
||||||
|
|
||||||
$date->setTimeZone($zone);
|
$date->setTimeZone($zone);
|
||||||
|
|
||||||
return $date->format($format);
|
return PhutilTranslator::getInstance()->translateDate($format, $date);
|
||||||
}
|
}
|
||||||
|
|
||||||
function phabricator_format_relative_time($duration) {
|
function phabricator_format_relative_time($duration) {
|
||||||
|
|
Loading…
Reference in a new issue