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