diff options
author | 2018-12-20 14:53:36 -0500 | |
---|---|---|
committer | 2018-12-20 14:53:36 -0500 | |
commit | b548c73d2cf4821e4725494460a3f9d8c08bedc7 (patch) | |
tree | 6dd435106a6e1f297b4472c8290992a8d9c19429 | |
parent | Fix json syntax (diff) | |
download | extensions-b548c73d2cf4821e4725494460a3f9d8c08bedc7.tar.gz extensions-b548c73d2cf4821e4725494460a3f9d8c08bedc7.tar.bz2 extensions-b548c73d2cf4821e4725494460a3f9d8c08bedc7.zip |
CommentStreams: Make timestamps relative to user
Signed-off-by: Brian Evans <grknight@gentoo.org>
-rw-r--r-- | CommentStreams/includes/Comment.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CommentStreams/includes/Comment.php b/CommentStreams/includes/Comment.php index 33304b35..c6744ac5 100644 --- a/CommentStreams/includes/Comment.php +++ b/CommentStreams/includes/Comment.php @@ -371,6 +371,10 @@ class Comment { */ public function getCreationDate() { if ( !is_null( $this->getCreationTimestamp() ) ) { + $user = RequestContext::getMain()->getUser(); + if ($user && !$user->isAnon()) { + $this->creation_timestamp->offsetForUser($user); + } return $this->creation_timestamp->format( "M j \a\\t g:i a" ); } return ""; @@ -398,6 +402,10 @@ class Comment { */ public function getModificationDate() { if ( !is_null( $this->getModificationTimestamp() ) ) { + $user = RequestContext::getMain()->getUser(); + if ($user && !$user->isAnon()) { + $this->modification_timestamp->offsetForUser($user); + } return $this->modification_timestamp->format( "M j \a\\t g:i a" ); } return null; |