display relative time if difference is less than 24 hours, even if days are not the same

This commit is contained in:
Athou
2013-05-25 15:46:42 +02:00
parent 8adcd35cb4
commit 89c4f999f0

View File

@@ -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');