Replace P100Y with an hour equivalent. #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In generating #10 I discovered that six of the unit tests did not pass. This was an odd failure. With some extra debugging I traced the failure to be checked at
MyDifferenceEvaluator; where it is converting both sides of the test comparison to milliseconds.With some extra logging I get:
It has converted
P100Yto3155763600000.3,155,763,600seconds;52,596,060minutes;876,601hours.876,600looks like 100 years in hours; there are 24 leap years in the next 100 years. (there were 25 leap years in the last 100 years)So where is that extra hour from? There would be the same number of daylight saving days in either case.
Given this comparison is using the
javax.xml.datatype.DatatypeFactoryto do the conversion, it feels like the issue is there.Regardless of the cause if the descrepency this PR allows the tests to pass.