Update relative time text for a change updated to say "just now"

Previously, formatted dates would say "a few seconds ago" if the
timestamp was less than a minute in the past.  This change updates the
text to say "just now" instead.

Bug: Issue 4423
Change-Id: Ie8e4070ce3c1c57fc23bb3de4c110423a563ff19
This commit is contained in:
beckysiegel
2016-09-14 15:52:00 -07:00
parent b89de4edb6
commit 2ca5e0fb45

View File

@@ -111,7 +111,12 @@
var date = moment(util.parseDate(dateStr));
if (!date.isValid()) { return ''; }
if (relative) {
return date.fromNow();
var dateFromNow = date.fromNow();
if (dateFromNow === 'a few seconds ago') {
return 'just now';
} else {
return dateFromNow;
}
}
var now = new Date();
var format = TimeFormats.MONTH_DAY_YEAR;