myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r377467 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java
Date Mon, 13 Feb 2006 19:09:03 GMT
Author: matzew
Date: Mon Feb 13 11:09:03 2006
New Revision: 377467

URL: http://svn.apache.org/viewcvs?rev=377467&view=rev
Log:
ensure that now silly date can be submitted (88. february for instance)

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java?rev=377467&r1=377466&r2=377467&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/HtmlInputDate.java
Mon Feb 13 11:09:03 2006
@@ -216,7 +216,9 @@
         }
 
         public Date parse() throws ParseException{
+        	Date retDate = null;
             Calendar tempCalendar=Calendar.getInstance();
+            tempCalendar.setLenient(Boolean.FALSE.booleanValue());
             if (timeZone != null)
                    tempCalendar.setTimeZone(timeZone);
             try{
@@ -237,10 +239,13 @@
 	            tempCalendar.set(Calendar.MINUTE,Integer.parseInt(minutes));
 	            tempCalendar.set(Calendar.SECOND,Integer.parseInt(seconds));
 	            tempCalendar.set(Calendar.MILLISECOND, 0);
+	            retDate = tempCalendar.getTime();
             } catch (NumberFormatException e) {
             	throw new ParseException(e.getMessage(),0);
+            } catch (IllegalArgumentException e) {
+            	throw new ParseException(e.getMessage(),0);
             } 
-            return tempCalendar.getTime();
+            return retDate;
         }
 
         private String formatedInt(String toFormat){



Mime
View raw message