mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-17 14:45:01 -05:00
fixed bug with twitter feed where it would sometimes say "undefined" if the post was more than a month old
This commit is contained in:
parent
376a22a355
commit
bd44056045
@ -68,7 +68,7 @@ function prettyDate(time) {
|
|||||||
var diff = ((current_date_full - date.getTime()) / 1000);
|
var diff = ((current_date_full - date.getTime()) / 1000);
|
||||||
var day_diff = Math.floor(diff / 86400);
|
var day_diff = Math.floor(diff / 86400);
|
||||||
|
|
||||||
if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31) return;
|
if (isNaN(day_diff) || day_diff < 0) return "<span>∞</span>";
|
||||||
|
|
||||||
return day_diff == 0 && (
|
return day_diff == 0 && (
|
||||||
diff < 60 && say.just_now ||
|
diff < 60 && say.just_now ||
|
||||||
@ -78,5 +78,5 @@ function prettyDate(time) {
|
|||||||
diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) ||
|
diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) ||
|
||||||
day_diff == 1 && say.yesterday ||
|
day_diff == 1 && say.yesterday ||
|
||||||
day_diff < 7 && day_diff + say.days_ago ||
|
day_diff < 7 && day_diff + say.days_ago ||
|
||||||
day_diff < 31 && Math.ceil(day_diff / 7) + say.weeks_ago;
|
day_diff > 7 && Math.ceil(day_diff / 7) + say.weeks_ago;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user