esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r988430 - /incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js
Date Tue, 24 Aug 2010 08:25:43 GMT
Author: rhirsch
Date: Tue Aug 24 08:25:43 2010
New Revision: 988430

URL: http://svn.apache.org/viewvc?rev=988430&view=rev
Log:
Fixed error for older messages

Modified:
    incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js

Modified: incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js?rev=988430&r1=988429&r2=988430&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/pretty.js Tue Aug 24 08:25:43 2010
@@ -10,9 +10,14 @@ function prettyDate(myDate){
 	var date = myDate,
 		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;
+		
+	if ( day_diff >= 31 )
+		return "more than 1 month ago";
 			
 	return day_diff == 0 && (
 			diff < 60 && "just now" ||



Mime
View raw message