Return months when > 31 days.

This commit is contained in:
Martin Elwin 2010-03-19 22:19:04 +08:00 committed by Brandon Mathis
parent 38fd8d6ee9
commit 362c7834d7

View File

@ -52,7 +52,7 @@ function prettyDate(time){
var diff = (((new Date()).getTime() - date.getTime()) / 1000)
var 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 && (
@ -63,7 +63,8 @@ function prettyDate(time){
diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
day_diff == 1 && "1 day ago" ||
day_diff < 7 && day_diff + " days ago" ||
day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago" ||
true && Math.ceil( day_diff / 30 ) + " months ago";
}
function getTwitterStatus(twitter_name){