2013-07-10 05:09:59 -07:00
|
|
|
<?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;
|
|
|
|
}
|
|
|
|
|
2014-02-26 14:46:18 -08:00
|
|
|
public function renderPropertyViewValue(array $handles) {
|
2013-07-10 12:34:09 -07:00
|
|
|
$absolute = phabricator_datetime(
|
2013-07-10 05:09:59 -07:00
|
|
|
$this->getObject()->getDateCreated(),
|
|
|
|
$this->getViewer());
|
2013-07-10 12:34:09 -07:00
|
|
|
|
2014-07-13 12:03:17 +10:00
|
|
|
$relative = phutil_format_relative_time_detailed(
|
2013-07-10 12:34:09 -07:00
|
|
|
time() - $this->getObject()->getDateCreated(),
|
|
|
|
$levels = 2);
|
|
|
|
|
|
|
|
return hsprintf('%s (%s)', $absolute, $relative);
|
2013-07-10 05:09:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|