ICEfaces
  1. ICEfaces
  2. ICE-8819

ace:dateTimeEntry - add new "lenientParsing" attribute (was: Incorrect date converted on client side)

    Details

    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Using the "dd/MM/yyyy hh:mm" pattern seems to help to keep the correct pattern.

      Description

      When using the following date pattern, dd/MM/yyyy, selecting a date displays the correct patter. Upon manually changing the day value to an incorrect value, the date is still converted to a valid day.

      For example:
       - Set a date via the popup calendar: 11/12/2012
       - Manually change the day value to: 211/12/2012
       - The date is converted to: 29/06/2013

      This is done on the client side so there is no chance to validate the date.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue. Follow similar steps as mentioned in the issue description.

        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. Follow similar steps as mentioned in the issue description.
        Hide
        yip.ng added a comment -

        This has nothing to do with jQuery datepicker. It is standard behavior with lenient Java date parsing. (Search the web to understand more.) If we set the leniency to false, then a stricter parsing would be done, resulting in a conversion error. See video http://screencast.com/t/QdBuCU6qF2.

        PF uses default leniency of true in Java date parsing. Change it to use false? Add an attribute for DateTimeEntry? Tell the user to use his own converter to do strict parsing?

        Show
        yip.ng added a comment - This has nothing to do with jQuery datepicker. It is standard behavior with lenient Java date parsing. (Search the web to understand more.) If we set the leniency to false, then a stricter parsing would be done, resulting in a conversion error. See video http://screencast.com/t/QdBuCU6qF2 . PF uses default leniency of true in Java date parsing. Change it to use false? Add an attribute for DateTimeEntry? Tell the user to use his own converter to do strict parsing?
        Hide
        yip.ng added a comment - - edited

        Done. See screenshot-01.

        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java
        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java
        Completed: At revision: 32793

        Show
        yip.ng added a comment - - edited Done. See screenshot-01. Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java Completed: At revision: 32793
        Hide
        Ken Fyten added a comment -

        Let's rename the new attribute to "lenientParsing".

        Show
        Ken Fyten added a comment - Let's rename the new attribute to "lenientParsing".
        Hide
        yip.ng added a comment -

        Done.

        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java
        Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java
        Completed: At revision: 32811

        Show
        yip.ng added a comment - Done. Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java Modified: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java Completed: At revision: 32811

          People

          • Assignee:
            yip.ng
            Reporter:
            Arran Mccullough
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: