mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Make custom "date" field feed stories human-readable
Summary: Fixes T10130. Test Plan: {F1060142} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10130 Differential Revision: https://secure.phabricator.com/D15004
This commit is contained in:
parent
dd21761df9
commit
b812a2171a
1 changed files with 36 additions and 0 deletions
|
@ -191,6 +191,42 @@ final class PhabricatorStandardCustomFieldDate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getApplicationTransactionTitleForFeed(
|
||||||
|
PhabricatorApplicationTransaction $xaction) {
|
||||||
|
|
||||||
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
|
$author_phid = $xaction->getAuthorPHID();
|
||||||
|
$object_phid = $xaction->getObjectPHID();
|
||||||
|
|
||||||
|
$old = $xaction->getOldValue();
|
||||||
|
$new = $xaction->getNewValue();
|
||||||
|
|
||||||
|
if (!$old) {
|
||||||
|
return pht(
|
||||||
|
'%s set %s to %s on %s.',
|
||||||
|
$xaction->renderHandleLink($author_phid),
|
||||||
|
$this->getFieldName(),
|
||||||
|
phabricator_datetime($new, $viewer),
|
||||||
|
$xaction->renderHandleLink($object_phid));
|
||||||
|
} else if (!$new) {
|
||||||
|
return pht(
|
||||||
|
'%s removed %s on %s.',
|
||||||
|
$xaction->renderHandleLink($author_phid),
|
||||||
|
$this->getFieldName(),
|
||||||
|
$xaction->renderHandleLink($object_phid));
|
||||||
|
} else {
|
||||||
|
return pht(
|
||||||
|
'%s changed %s from %s to %s on %s.',
|
||||||
|
$xaction->renderHandleLink($author_phid),
|
||||||
|
$this->getFieldName(),
|
||||||
|
phabricator_datetime($old, $viewer),
|
||||||
|
phabricator_datetime($new, $viewer),
|
||||||
|
$xaction->renderHandleLink($object_phid));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function shouldAppearInConduitTransactions() {
|
public function shouldAppearInConduitTransactions() {
|
||||||
// TODO: Dates are complicated and we don't yet support handling them from
|
// TODO: Dates are complicated and we don't yet support handling them from
|
||||||
// Conduit.
|
// Conduit.
|
||||||
|
|
Loading…
Reference in a new issue