Browse code

fixed bug with twitter feed where it would sometimes say "undefined" if the post was more than a month old

Brandon Mathis authored on 02/09/2011 at 21:43:49
Showing 1 changed files
... ...
@@ -68,7 +68,7 @@ function prettyDate(time) {
68 68
   var diff = ((current_date_full - date.getTime()) / 1000);
69 69
   var day_diff = Math.floor(diff / 86400);
70 70
 
71
-  if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31) return;
71
+  if (isNaN(day_diff) || day_diff < 0) return "<span>&infin;</span>";
72 72
 
73 73
   return day_diff == 0 && (
74 74
     diff < 60 && say.just_now ||
... ...
@@ -78,5 +78,5 @@ function prettyDate(time) {
78 78
     diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) ||
79 79
     day_diff == 1 && say.yesterday ||
80 80
     day_diff < 7 && day_diff + say.days_ago ||
81
-    day_diff < 31 && Math.ceil(day_diff / 7) + say.weeks_ago;
81
+    day_diff > 7 && Math.ceil(day_diff / 7) + say.weeks_ago;
82 82
 }