mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
display relative time if difference is less than 24 hours, even if days are not the same
This commit is contained in:
@@ -9,7 +9,7 @@ module.filter('entryDate', function() {
|
||||
var d = moment(timestamp);
|
||||
var now = moment();
|
||||
var formatted;
|
||||
if (d.date() === now.date() && Math.abs(d.diff(now)) < 86400000) {
|
||||
if (Math.abs(d.diff(now)) < 86400000) {
|
||||
formatted = d.fromNow();
|
||||
} else {
|
||||
formatted = d.format('YYYY-MM-DD HH:mm');
|
||||
|
||||
Reference in New Issue
Block a user