mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Use user's timezone in repo history
Test Plan: Looked at repo overview, repo history and commit detail. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4250
This commit is contained in:
parent
ef214e94ce
commit
ebe2a58f8a
6 changed files with 15 additions and 10 deletions
|
@ -782,6 +782,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
}
|
||||
|
||||
$history_table = new DiffusionHistoryTableView();
|
||||
$history_table->setUser($this->getRequest()->getUser());
|
||||
$history_table->setDiffusionRequest($drequest);
|
||||
$history_table->setHistory($merges);
|
||||
$history_table->loadRevisions();
|
||||
|
|
|
@ -56,6 +56,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
|||
phutil_escape_html($button_title));
|
||||
|
||||
$history_table = new DiffusionHistoryTableView();
|
||||
$history_table->setUser($request->getUser());
|
||||
$history_table->setDiffusionRequest($drequest);
|
||||
$history_table->setHistory($history);
|
||||
$history_table->loadRevisions();
|
||||
|
|
|
@ -23,8 +23,10 @@ final class DiffusionLastModifiedController extends DiffusionController {
|
|||
$phids = array_keys($phids);
|
||||
$handles = $this->loadViewerHandles($phids);
|
||||
|
||||
$output = DiffusionBrowseTableView::renderLastModifiedColumns(
|
||||
$drequest,
|
||||
$view = new DiffusionBrowseTableView();
|
||||
$view->setUser($request->getUser());
|
||||
$view->setDiffusionRequest($drequest);
|
||||
$output = $view->renderLastModifiedColumns(
|
||||
$handles,
|
||||
$commit,
|
||||
$commit_data);
|
||||
|
|
|
@ -51,6 +51,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||
$handles = $this->loadViewerHandles($phids);
|
||||
|
||||
$history_table = new DiffusionHistoryTableView();
|
||||
$history_table->setUser($this->getRequest()->getUser());
|
||||
$history_table->setDiffusionRequest($drequest);
|
||||
$history_table->setHandles($handles);
|
||||
$history_table->setHistory($history);
|
||||
|
|
|
@ -17,20 +17,21 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public static function renderLastModifiedColumns(
|
||||
DiffusionRequest $drequest,
|
||||
public function renderLastModifiedColumns(
|
||||
array $handles,
|
||||
PhabricatorRepositoryCommit $commit = null,
|
||||
PhabricatorRepositoryCommitData $data = null) {
|
||||
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
||||
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
|
||||
if ($commit) {
|
||||
$epoch = $commit->getEpoch();
|
||||
$modified = DiffusionView::linkCommit(
|
||||
$drequest->getRepository(),
|
||||
$commit->getCommitIdentifier());
|
||||
$date = date('M j, Y', $epoch);
|
||||
$time = date('g:i A', $epoch);
|
||||
$date = phabricator_date($epoch, $this->user);
|
||||
$time = phabricator_time($epoch, $this->user);
|
||||
} else {
|
||||
$modified = '';
|
||||
$date = '';
|
||||
|
@ -169,8 +170,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||
if ($commit) {
|
||||
$drequest = clone $request;
|
||||
$drequest->setPath($request->getPath().$path->getPath().$dir_slash);
|
||||
$dict = self::renderLastModifiedColumns(
|
||||
$drequest,
|
||||
$dict = $this->renderLastModifiedColumns(
|
||||
$this->handles,
|
||||
$commit,
|
||||
$path->getLastCommitData());
|
||||
|
|
|
@ -74,8 +74,8 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
|||
$epoch = $history->getEpoch();
|
||||
|
||||
if ($epoch) {
|
||||
$date = date('M j, Y', $epoch);
|
||||
$time = date('g:i A', $epoch);
|
||||
$date = phabricator_date($epoch, $this->user);
|
||||
$time = phabricator_time($epoch, $this->user);
|
||||
} else {
|
||||
$date = null;
|
||||
$time = null;
|
||||
|
|
Loading…
Reference in a new issue