Use phabricator_ time functions in more places
Summary: Replace some more date() calls with locale-aware calls. Also, at least on my system, the DateTimeZone / DateTime stuff didn't actually work and always rendered in UTC. Fixed that. Test Plan: Viewed daemon console, differential revisions, files, and maniphest timestamps in multiple timezones. Reviewed By: toulouse Reviewers: toulouse, fratrik, jungejason, aran, tuomaspelkonen CC: aran, toulouse Differential Revision: 530
This commit is contained in:
@@ -28,6 +28,9 @@ class PhabricatorFileViewController extends PhabricatorFileController {
|
||||
|
||||
public function processRequest() {
|
||||
|
||||
$request = $this->getRequest();
|
||||
$user = $request->getUser();
|
||||
|
||||
$file = id(new PhabricatorFile())->loadOneWhere(
|
||||
'phid = %s',
|
||||
$this->phid);
|
||||
@@ -93,7 +96,7 @@ class PhabricatorFileViewController extends PhabricatorFileController {
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Created')
|
||||
->setName('created')
|
||||
->setValue(date('Y-m-d g:i:s A', $file->getDateCreated())))
|
||||
->setValue(phabricator_datetime($file->getDateCreated(), $user)))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Mime Type')
|
||||
|
||||
@@ -18,6 +18,7 @@ phutil_require_module('phabricator', 'view/form/base');
|
||||
phutil_require_module('phabricator', 'view/form/control/static');
|
||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||
phutil_require_module('phabricator', 'view/layout/panel');
|
||||
phutil_require_module('phabricator', 'view/utils');
|
||||
|
||||
phutil_require_module('phutil', 'markup');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
Reference in New Issue
Block a user