1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/people/customfield/PhabricatorUserSinceField.php
James Rhodes 9cb6b2cfcc Remove user-independent date and time functions from Phabricator
Summary: These have been moved into libphutil.

Test Plan: Browsed Phabricator, didn't see a crash.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9907
2014-07-13 12:03:17 +10:00

36 lines
756 B
PHP

<?php
final class PhabricatorUserSinceField
extends PhabricatorUserCustomField {
private $value;
public function getFieldKey() {
return 'user:since';
}
public function getFieldName() {
return pht('User Since');
}
public function getFieldDescription() {
return pht('Shows user join date.');
}
public function shouldAppearInPropertyView() {
return true;
}
public function renderPropertyViewValue(array $handles) {
$absolute = phabricator_datetime(
$this->getObject()->getDateCreated(),
$this->getViewer());
$relative = phutil_format_relative_time_detailed(
time() - $this->getObject()->getDateCreated(),
$levels = 2);
return hsprintf('%s (%s)', $absolute, $relative);
}
}