[MAGNOLIA-4442] Do not re-implement ISO date conversion Created: 14/Jun/12  Updated: 15/Mar/21  Resolved: 15/Mar/21

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.5.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Jan Haderka Assignee: Unassigned
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-4441 Review util classes Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 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).


Generated at Mon Feb 12 03:55:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.