extend utils.ago to handle dates beyond 31 days
This commit is contained in:
parent
63f03e1111
commit
27ba6d795f
@ -20,7 +20,7 @@ define({
|
||||
var diff = (((new Date()).getTime() - date.getTime()) / 1000),
|
||||
day_diff = Math.floor(diff / 86400);
|
||||
|
||||
if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31)
|
||||
if (isNaN(day_diff) || day_diff < 0)
|
||||
return;
|
||||
|
||||
return day_diff == 0 && (
|
||||
@ -31,7 +31,9 @@ define({
|
||||
diff < 86400 && "vor " + Math.floor(diff / 3600) + " Stunden") ||
|
||||
day_diff == 1 && "Gestern" ||
|
||||
day_diff < 7 && "vor " + day_diff + " Tagen" ||
|
||||
day_diff < 31 && "vor " + Math.ceil(day_diff / 7) + " Wochen";
|
||||
day_diff < 31 && "vor " + Math.ceil(day_diff / 7) + " Wochen" ||
|
||||
day_diff < 365 && "vor " + Math.ceil(day_diff / 30) + " Monaten" ||
|
||||
"vor " + Math.ceil(day_diff / 365.25) + " Jahren";
|
||||
},
|
||||
|
||||
heading: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user