esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r836262 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib: StreamMgr.scala UserMgr.scala
Date Sat, 14 Nov 2009 20:48:08 GMT
Author: rhirsch
Date: Sat Nov 14 20:48:08 2009
New Revision: 836262

URL: http://svn.apache.org/viewvc?rev=836262&view=rev
Log:
[ESME-125] Change Date format to make lists sortable: Users and Streams pages

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala?rev=836262&r1=836261&r2=836262&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/StreamMgr.scala Sat Nov
14 20:48:08 2009
@@ -20,6 +20,7 @@
  */
 
 package org.apache.esme.lib
+import java.text.SimpleDateFormat
 
 import net.liftweb._
 import http._
@@ -97,6 +98,8 @@
       def nicknameWithProfileLink(u: User): NodeSeq = {
     		  <a href={"/user/" + urlEncode(u.nickname.is)}>{u.niceName}</a>
       	}
+      	
+      val dateFormatter = new SimpleDateFormat("yyyy/MM/dd hh:mm")
         
       Message.findAll(query: _*) match {
         case Nil => NodeSeq.Empty
@@ -105,7 +108,7 @@
                         (lst => xs.flatMap(i => bind("item", lst,
                                                      "author" -> i.author.obj.map(nicknameWithProfileLink).openOr(Text("")),
                                                      "text" -> i.digestedXHTML,
-                                                     "date" -> new java.util.Date(i.when.toLong).toString
+                                                     "date" -> dateFormatter.format(i.getWhen)
                 ))))
       }
     }

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala?rev=836262&r1=836261&r2=836262&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/UserMgr.scala Sat Nov 14
20:48:08 2009
@@ -24,6 +24,7 @@
 import java.text.SimpleDateFormat
 import scala.xml.{NodeSeq}
 
+
 import net.liftweb._
 import http._
 import SHtml._
@@ -39,6 +40,7 @@
 import model._
 import org.apache.esme.model.{Message, User}
 
+
 /**
  * Manage the sitemap and related snippets for the display of users
  */
@@ -74,7 +76,7 @@
     <a href={"/user/" + urlEncode(u.nickname.is)}>{u.niceName}</a>
   }
   
-  private val dateFormatter = new SimpleDateFormat("hh:mm a MMM d, yyyy")
+  private val dateFormatter = new SimpleDateFormat("yyyy/MM/dd hh:mm")
   
   private def lastMessage(user: User): Tuple2[String,String] = {
     Message.findAll(By(Message.author, user), OrderBy(Message.id, Descending), MaxRows(1))
match {



Mime
View raw message