summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-10-28 08:07:39 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-10-28 08:07:39 -0400
commit32978e59f9b5923866b918a9c11371cfea18bc72 (patch)
treef7cc761bbc0bd793276f94ff1fd3ea5a88c719ed /web/react/utils/utils.jsx
parent570b54bbfc0151724aa10f61ca0beb4d38351cb9 (diff)
parentc91f4f8ab12c07db0ddac1de5dfda12961cf95ba (diff)
downloadchat-32978e59f9b5923866b918a9c11371cfea18bc72.tar.gz
chat-32978e59f9b5923866b918a9c11371cfea18bc72.tar.bz2
chat-32978e59f9b5923866b918a9c11371cfea18bc72.zip
Merge pull request #1205 from florianorben/fix-relative-time
Dont display '1 minute ago' timestamps for post posted < than 1 minute ago
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index fadab27a7..3140a5d77 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -211,11 +211,15 @@ export function displayDateTime(ticks) {
}
interval = Math.floor(seconds / 60);
- if (interval > 1) {
+ if (interval >= 2) {
return interval + ' minutes ago';
}
- return '1 minute ago';
+ if (interval >= 1) {
+ return '1 minute ago';
+ }
+
+ return 'just now';
}
export function displayCommentDateTime(ticks) {