myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From caga...@apache.org
Subject svn commit: r537856 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
Date Mon, 14 May 2007 14:33:45 GMT
Author: cagatay
Date: Mon May 14 07:33:44 2007
New Revision: 537856

URL: http://svn.apache.org/viewvc?view=rev&rev=537856
Log:
Fixed TOMAHAWK-986, locale info is always used to create the header date string. Locale used
here is the calculated locale for the current view other than just the default locale of the
application.

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java?view=diff&rev=537856&r1=537855&r2=537856
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/schedule/renderer/AbstractScheduleRenderer.java
Mon May 14 07:33:44 2007
@@ -39,6 +39,7 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 import java.util.Map;
 
 /**
@@ -214,22 +215,15 @@
     {
         DateFormat format;
         String pattern = getHeaderDateFormat(component);
+        Locale viewLocale = context.getViewRoot().getLocale();
 
         if ((pattern != null) && (pattern.length() > 0))
         {
-            format = new SimpleDateFormat(pattern);
+        	format = new SimpleDateFormat(pattern, viewLocale);
         }
         else
         {
-            if (context.getApplication().getDefaultLocale() != null)
-            {
-                format = DateFormat.getDateInstance(DateFormat.MEDIUM, context
-                        .getApplication().getDefaultLocale());
-            }
-            else
-            {
-                format = DateFormat.getDateInstance(DateFormat.MEDIUM);
-            }
+        	format = DateFormat.getDateInstance(DateFormat.MEDIUM, viewLocale);
         }
 
         return format.format(date);



Mime
View raw message