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:
@@ -782,6 +782,7 @@ final class DiffusionCommitController extends DiffusionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$history_table = new DiffusionHistoryTableView();
|
$history_table = new DiffusionHistoryTableView();
|
||||||
|
$history_table->setUser($this->getRequest()->getUser());
|
||||||
$history_table->setDiffusionRequest($drequest);
|
$history_table->setDiffusionRequest($drequest);
|
||||||
$history_table->setHistory($merges);
|
$history_table->setHistory($merges);
|
||||||
$history_table->loadRevisions();
|
$history_table->loadRevisions();
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ final class DiffusionHistoryController extends DiffusionController {
|
|||||||
phutil_escape_html($button_title));
|
phutil_escape_html($button_title));
|
||||||
|
|
||||||
$history_table = new DiffusionHistoryTableView();
|
$history_table = new DiffusionHistoryTableView();
|
||||||
|
$history_table->setUser($request->getUser());
|
||||||
$history_table->setDiffusionRequest($drequest);
|
$history_table->setDiffusionRequest($drequest);
|
||||||
$history_table->setHistory($history);
|
$history_table->setHistory($history);
|
||||||
$history_table->loadRevisions();
|
$history_table->loadRevisions();
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ final class DiffusionLastModifiedController extends DiffusionController {
|
|||||||
$phids = array_keys($phids);
|
$phids = array_keys($phids);
|
||||||
$handles = $this->loadViewerHandles($phids);
|
$handles = $this->loadViewerHandles($phids);
|
||||||
|
|
||||||
$output = DiffusionBrowseTableView::renderLastModifiedColumns(
|
$view = new DiffusionBrowseTableView();
|
||||||
$drequest,
|
$view->setUser($request->getUser());
|
||||||
|
$view->setDiffusionRequest($drequest);
|
||||||
|
$output = $view->renderLastModifiedColumns(
|
||||||
$handles,
|
$handles,
|
||||||
$commit,
|
$commit,
|
||||||
$commit_data);
|
$commit_data);
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||||||
$handles = $this->loadViewerHandles($phids);
|
$handles = $this->loadViewerHandles($phids);
|
||||||
|
|
||||||
$history_table = new DiffusionHistoryTableView();
|
$history_table = new DiffusionHistoryTableView();
|
||||||
|
$history_table->setUser($this->getRequest()->getUser());
|
||||||
$history_table->setDiffusionRequest($drequest);
|
$history_table->setDiffusionRequest($drequest);
|
||||||
$history_table->setHandles($handles);
|
$history_table->setHandles($handles);
|
||||||
$history_table->setHistory($history);
|
$history_table->setHistory($history);
|
||||||
|
|||||||
@@ -17,20 +17,21 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function renderLastModifiedColumns(
|
public function renderLastModifiedColumns(
|
||||||
DiffusionRequest $drequest,
|
|
||||||
array $handles,
|
array $handles,
|
||||||
PhabricatorRepositoryCommit $commit = null,
|
PhabricatorRepositoryCommit $commit = null,
|
||||||
PhabricatorRepositoryCommitData $data = null) {
|
PhabricatorRepositoryCommitData $data = null) {
|
||||||
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
assert_instances_of($handles, 'PhabricatorObjectHandle');
|
||||||
|
|
||||||
|
$drequest = $this->getDiffusionRequest();
|
||||||
|
|
||||||
if ($commit) {
|
if ($commit) {
|
||||||
$epoch = $commit->getEpoch();
|
$epoch = $commit->getEpoch();
|
||||||
$modified = DiffusionView::linkCommit(
|
$modified = DiffusionView::linkCommit(
|
||||||
$drequest->getRepository(),
|
$drequest->getRepository(),
|
||||||
$commit->getCommitIdentifier());
|
$commit->getCommitIdentifier());
|
||||||
$date = date('M j, Y', $epoch);
|
$date = phabricator_date($epoch, $this->user);
|
||||||
$time = date('g:i A', $epoch);
|
$time = phabricator_time($epoch, $this->user);
|
||||||
} else {
|
} else {
|
||||||
$modified = '';
|
$modified = '';
|
||||||
$date = '';
|
$date = '';
|
||||||
@@ -169,8 +170,7 @@ final class DiffusionBrowseTableView extends DiffusionView {
|
|||||||
if ($commit) {
|
if ($commit) {
|
||||||
$drequest = clone $request;
|
$drequest = clone $request;
|
||||||
$drequest->setPath($request->getPath().$path->getPath().$dir_slash);
|
$drequest->setPath($request->getPath().$path->getPath().$dir_slash);
|
||||||
$dict = self::renderLastModifiedColumns(
|
$dict = $this->renderLastModifiedColumns(
|
||||||
$drequest,
|
|
||||||
$this->handles,
|
$this->handles,
|
||||||
$commit,
|
$commit,
|
||||||
$path->getLastCommitData());
|
$path->getLastCommitData());
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ final class DiffusionHistoryTableView extends DiffusionView {
|
|||||||
$epoch = $history->getEpoch();
|
$epoch = $history->getEpoch();
|
||||||
|
|
||||||
if ($epoch) {
|
if ($epoch) {
|
||||||
$date = date('M j, Y', $epoch);
|
$date = phabricator_date($epoch, $this->user);
|
||||||
$time = date('g:i A', $epoch);
|
$time = phabricator_time($epoch, $this->user);
|
||||||
} else {
|
} else {
|
||||||
$date = null;
|
$date = null;
|
||||||
$time = null;
|
$time = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user