Closed hadrienk closed 1 month ago
Using the threeten-extra (additional date-time classes that complement those in Java SE 8.) the mapping can be as follow:
date -> java.time.Instant time_period -> Interval duration -> PeriodDuration
date
time_period
duration
This simplify the parsing of ISO_8601 format.
Test case:
d1 := cast("P1Y2M10DT2H30M", duration); d2 := cast("P1Y15M2DT086401S", duration); p1 := cast("2015-03-03T09:30:45Z/2018-04-05T12:30:15Z", time_period); p2 := cast("2007-03-01T13:00:00Z/P1Y2M10DT2H30M", time_period); p3 := cast("P1Y2M10DT2H30M/2008-05-11T15:30:00Z", time_period);
The truncated representation of period is left unimplemented as it seems to be deprecated
p3 := cast("P1Y2M10DT2H30M/2008-05-11T15:30:00Z", time_period);
Failed conditions 62.2% Coverage on New Code (required ≥ 80%) 4.7% Duplication on New Code (required ≤ 3%)
See analysis details on SonarCloud
Using the threeten-extra (additional date-time classes that complement those in Java SE 8.) the mapping can be as follow:
date
-> java.time.Instanttime_period
-> Intervalduration
-> PeriodDurationThis simplify the parsing of ISO_8601 format.
Test case:
The truncated representation of period is left unimplemented as it seems to be deprecated