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

Do not re-implement ISO date conversion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Outdated
    • Neutral
    • None
    • 4.5.3
    • core
    • None

    Description

      Currently info.magnolia.jcr.util.PropertyUtil.createValue(String, int, ValueFactory) reimplements String (ISO8601) to Calendar conversion. There's no need to do so. JackRabbit or JoDa have API for such conversion as have many other libraries (e.g. JAXB).
      JackRabbit:
      Calendar cal = org.apache.jackrabbit.util.ISO8601.parse(s);
      Calendar cal = org.apache.jackrabbit.core.util.ISO8601.parse(s);
      JoDa:
      Calendar cal = org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis().parseDateTime(s);

      Current code is ugly and doesn't handle time zones properly (hence the bug and not just improvement).

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                had Jan Haderka
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD