jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r649970 - /incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java
Date Sun, 20 Apr 2008 20:13:36 GMT
Author: jalkanen
Date: Sun Apr 20 13:13:35 2008
New Revision: 649970

URL: http://svn.apache.org/viewvc?rev=649970&view=rev
Log:
Now properly uses proper routines instead of hard-coded defaults for date.

Modified:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java?rev=649970&r1=649969&r2=649970&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java Sun Apr 20 13:13:35
2008
@@ -25,6 +25,8 @@
 import java.io.IOException;
 
 import com.ecyrd.jspwiki.WikiPage;
+import com.ecyrd.jspwiki.preferences.Preferences;
+import com.ecyrd.jspwiki.preferences.Preferences.TimeFormat;
 
 /**
  *  Writes the modification date of the page, formatted
@@ -57,9 +59,6 @@
 
     public String getFormat()
     {
-        if( m_format == null )
-            return DEFAULT_FORMAT;
-
         return m_format;
     }
 
@@ -82,7 +81,12 @@
             //
             if( d != null )
             {
-                SimpleDateFormat fmt = new SimpleDateFormat( getFormat() );
+                SimpleDateFormat fmt;
+                
+                if( m_format == null )
+                    fmt = Preferences.getDateFormat( m_wikiContext, TimeFormat.DATETIME );
+                else
+                    fmt = new SimpleDateFormat( m_format );
 
                 pageContext.getOut().write( fmt.format( d ) );
             }



Mime
View raw message