1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 04:31:13 +01:00

Correct an issue where the commit list could group commits by server time

Summary:
Commits in the list are grouped by the date they occurred in server time. This may not be the date they occurred in client time.

Use client time, not server time, to group commits.

Test Plan:
- Set server timezone to "Asia/Famagusta".
- Set client timezone to "America/Los_Angeles".
- Viewed Phabricator repository history.

Here's what it looks like before the change:

{F4987094}

Note that the headers of the first two groups both say "Yesterday".

This is because the first commits in each group occurred on June 1 and June 2, respectively, in Famagusta, but both occurred on June 1 in Los Angeles.

Here's what it looks like after the change:

{F4987095}

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D18067
This commit is contained in:
epriestley 2017-06-02 04:47:59 -07:00
parent 335c3a7d12
commit 5335f29ff2

View file

@ -23,15 +23,12 @@ final class DiffusionHistoryListView extends DiffusionHistoryView {
'PhabricatorHarbormasterApplication',
$this->getUser());
$rows = array();
$ii = 0;
$cur_date = 0;
$header = null;
$cur_date = null;
$view = array();
foreach ($this->getHistory() as $history) {
$epoch = $history->getEpoch();
$new_date = date('Ymd', $history->getEpoch());
if ($cur_date != $new_date) {
$new_date = phabricator_date($history->getEpoch(), $viewer);
if ($cur_date !== $new_date) {
$date = ucfirst(
phabricator_relative_date($history->getEpoch(), $viewer));
$header = id(new PHUIHeaderView())