You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2008/04/20 22:13:36 UTC

svn commit: r649970 - /incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/tags/PageDateTag.java

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 ) );
             }