[ 
http://issues.apache.org/jira/browse/MYFACES-459?page=comments#action_12320542 
] 

Keijo Nurmes commented on MYFACES-459:
--------------------------------------

I think that 35.01.2005 (DD.MM.YYY) type of dates should not be converted to 
valid dates either.
Now 35.01.2005 converts to 4.2.2005 ....

This little patch takes care of it.... 


Index: api/src/java/javax/faces/convert/DateTimeConverter.java
===================================================================
--- api/src/java/javax/faces/convert/DateTimeConverter.java     (revision 
231413)
+++ api/src/java/javax/faces/convert/DateTimeConverter.java     (working copy)
@@ -69,7 +69,7 @@
             if (value.length() > 0)
             {
                 DateFormat format = getDateFormat();
-                format.setLenient(true);
+                format.setLenient(false);
                 TimeZone tz = getTimeZone();
                 if( tz != null )
                        format.setTimeZone( tz );


> DateTimeConverter should not allow lenient date formatting
> ----------------------------------------------------------
>
>          Key: MYFACES-459
>          URL: http://issues.apache.org/jira/browse/MYFACES-459
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.0.9 beta
>     Reporter: sean schofield

>
> If your converter has a date format of  "MM/DD/YYYY" and you supply it the 
> String "9/5/05" the date should *not* be allowed.  From the spec (javadoc): 
> "In all cases, parsing must be non-lenient; the given string must strictly 
> adhere to the parsing format."

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to