summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-10-28 01:19:15 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-10-28 01:19:57 +0100
commitc91f4f8ab12c07db0ddac1de5dfda12961cf95ba (patch)
tree3a7d5dfdbd58fb5ea6344f05b833b0da459c0d6f /web
parentede80afe4cce19b4c561f028220ccc21f2581605 (diff)
downloadchat-c91f4f8ab12c07db0ddac1de5dfda12961cf95ba.tar.gz
chat-c91f4f8ab12c07db0ddac1de5dfda12961cf95ba.tar.bz2
chat-c91f4f8ab12c07db0ddac1de5dfda12961cf95ba.zip
Dont display '1 minute ago' timestamps for post posted < than 1 minute ago
Diffstat (limited to 'web')
-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) {