1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Revert "Revert "Mark date and time format translatable""

This reverts commit 24a025becb.
This commit is contained in:
Andrew Gallagher 2012-06-28 18:08:59 -07:00
parent 24a025becb
commit 47cb5d3cc3

View file

@ -54,21 +54,21 @@ function phabricator_time($epoch, $user) {
return phabricator_format_local_time(
$epoch,
$user,
'g:i A');
pht('g:i A'));
}
function phabricator_datetime($epoch, $user) {
function phabricator_datetime($epoch, $user) {
return phabricator_format_local_time(
$epoch,
$user,
_phabricator_date_format($epoch).', g:i A');
pht('%s, g:i A', _phabricator_date_format($epoch)));
}
function _phabricator_date_format($epoch) {
$format = 'M j Y';
$format = pht('M j Y');
$now = time();
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
$format = 'D, M j';
$format = pht('D, M j');
}
return $format;
}
@ -115,7 +115,7 @@ function phabricator_format_local_time($epoch, $user, $format) {
$date->setTimeZone($zone);
return $date->format($format);
return PhutilTranslator::getInstance()->translateDate($format, $date);
}
function phabricator_format_relative_time($duration) {