mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Display day of week in dates
Summary: I've found it quite useful to know day of week of most displayed dates. This is useful in periodic workflows (e.g. cut on Sunday, push on Tuesday). It adds the day only to recent dates to save some space (similar approach as `ls -l`). Test Plan: / Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Maniphest Tasks: T1034 Differential Revision: https://secure.phabricator.com/D1984
This commit is contained in:
parent
b028920a5e
commit
b023480277
1 changed files with 11 additions and 2 deletions
|
@ -20,7 +20,7 @@ function phabricator_date($epoch, $user) {
|
|||
return __phabricator_format_local_time(
|
||||
$epoch,
|
||||
$user,
|
||||
'M j Y');
|
||||
__phabricator_date_format($epoch));
|
||||
}
|
||||
|
||||
function phabricator_on_relative_date($epoch, $user) {
|
||||
|
@ -61,7 +61,16 @@ function phabricator_datetime($epoch, $user) {
|
|||
return __phabricator_format_local_time(
|
||||
$epoch,
|
||||
$user,
|
||||
'M j Y, g:i A');
|
||||
__phabricator_date_format($epoch).', g:i A');
|
||||
}
|
||||
|
||||
function __phabricator_date_format($epoch) {
|
||||
$format = 'M j Y';
|
||||
$now = time();
|
||||
if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) {
|
||||
$format = 'D, M j';
|
||||
}
|
||||
return $format;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue