Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIHeaderView.php
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | final class PHUIHeaderView extends AphrontTagView { | ||||
public function setEpoch($epoch) { | public function setEpoch($epoch) { | ||||
$age = time() - $epoch; | $age = time() - $epoch; | ||||
$age = floor($age / (60 * 60 * 24)); | $age = floor($age / (60 * 60 * 24)); | ||||
if ($age < 1) { | if ($age < 1) { | ||||
$when = pht('Today'); | $when = pht('Today'); | ||||
} else if ($age == 1) { | } else if ($age == 1) { | ||||
$when = pht('Yesterday'); | $when = pht('Yesterday'); | ||||
} else { | } else { | ||||
$when = pht('%d Days Ago', $age); | $when = pht('%s Day(s) Ago', new PhutilNumber($age)); | ||||
} | } | ||||
$this->setStatus('fa-clock-o bluegrey', null, pht('Updated %s', $when)); | $this->setStatus('fa-clock-o bluegrey', null, pht('Updated %s', $when)); | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function getTagName() { | protected function getTagName() { | ||||
return 'div'; | return 'div'; | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |