myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gcrawf...@apache.org
Subject svn commit: r639871 - in /myfaces/trinidad/trunk: trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java
Date Fri, 21 Mar 2008 21:40:56 GMT
Author: gcrawford
Date: Fri Mar 21 14:40:54 2008
New Revision: 639871

URL: http://svn.apache.org/viewvc?rev=639871&view=rev
Log:
TRINIDAD-1020 Incomplete fix for TRINIDAD-61 (tr:validateDateTimeRange validation fails on
last day of valid range)

Thanks to Yee Wah

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java?rev=639871&r1=639870&r2=639871&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
Fri Mar 21 14:40:54 2008
@@ -467,6 +467,11 @@
     {
       Date d = _parseISODate(value);
       Calendar c = Calendar.getInstance();
+      TimeZone tz = RequestContext.getCurrentInstance().getTimeZone();
+      if (tz != null)
+        c.setTimeZone(tz);
+       // Original value had 00:00:00 for hours,mins, seconds now maximize those
+       // to get the latest time value for the date supplied.
       c.setTime(d);
       c.set (Calendar.HOUR_OF_DAY, 23);
       c.set (Calendar.MINUTE, 59);

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java?rev=639871&r1=639870&r2=639871&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/taglib/util/TagUtils.java
Fri Mar 21 14:40:54 2008
@@ -171,9 +171,15 @@
   public static Date getDateWithMaxTime(
     String      value)
   {
-     Calendar c = Calendar.getInstance();
-     Date d = _parseISODate(value);
+
+    Date d = _parseISODate(value);
+    Calendar c = Calendar.getInstance();
+    TimeZone tz = RequestContext.getCurrentInstance().getTimeZone();
+    if (tz != null)
+      c.setTimeZone(tz);
      c.setTime(d);
+     // Original value had 00:00:00 for hours,mins, seconds now maximize those
+     // to get the latest time value for the date supplied.
      c.set (Calendar.HOUR_OF_DAY, 23);
      c.set (Calendar.MINUTE, 59);
      c.set (Calendar.SECOND, 59);
@@ -341,7 +347,7 @@
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
     TimeZone tz = RequestContext.getCurrentInstance().getTimeZone();
     if (tz != null)
-      sdf.setTimeZone(tz);
+      sdf.setTimeZone(tz);    
     return sdf;    
   }
 



Mime
View raw message