Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5937

PropertyUtil#createValue does not properly parse iso8601 date strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • 5.3.3
    • None
    • None

    Description

      For example it cannot process this date string: 2014-10-01T13:11:27.000+02:00
      It fails in parsing the seconds as it tries to convert '27.000+02' to an int.

      A possible replacement for the entire try block would be DatetypeConverter#parseDateTime.
      (http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/DatatypeConverter.html#parseDateTime%28java.lang.String%29)
      See http://stackoverflow.com/questions/12201233/convert-iso8601-string-date-time-format-to-date-in-java

      You can reproduce this by:
      Opening the JCRBrowser to /demo-project/news-and-events/events-overview/new-year-s-eve@dateEnd
      Switch type to a string.
      Switch type back to a date.
      It will now show the current date since the string to date conversion failed.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                czimmermann Christopher Zimmermann
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Bug DoR
                    Task DoD