Add setEpoch for PHUIHeaderView, use in all Documents
Summary: Sets a consistent last update time in the header of PHUIDocuments, Legalpad, Diviner, Phriction. I'm not set on the exact language, just that there is consistency, feel free to suggest changes.
Test Plan:
Test Legalpad, Diviner, Phriction.
{F368270}
Reviewers: btrahan, epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D12384
This commit is contained in:
@@ -194,7 +194,8 @@ final class PhrictionDocumentController
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setUser($user)
|
||||
->setPolicyObject($document)
|
||||
->setHeader($page_title);
|
||||
->setHeader($page_title)
|
||||
->setEpoch($content->getDateCreated());
|
||||
|
||||
$prop_list = null;
|
||||
if ($properties) {
|
||||
@@ -244,17 +245,6 @@ final class PhrictionDocumentController
|
||||
pht('Last Author'),
|
||||
$viewer->renderHandle($content->getAuthorPHID()));
|
||||
|
||||
$age = time() - $content->getDateCreated();
|
||||
$age = floor($age / (60 * 60 * 24));
|
||||
if ($age < 1) {
|
||||
$when = pht('Today');
|
||||
} else if ($age == 1) {
|
||||
$when = pht('Yesterday');
|
||||
} else {
|
||||
$when = pht('%d Days Ago', $age);
|
||||
}
|
||||
$view->addProperty(pht('Last Updated'), $when);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user