-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
The current implementation of JulianDate.createFromIso8601 uses Date.parse which according to ECMAScript 5 supports ISO8601 dates. This has two major problems:
- ISO8601 supports fractional milliseconds but Date is only accurate to the millisecond, so any conversions with fractional milliseconds are rounded and less accurate.
- ISO8601 and JulianDate both support leap seconds, but Date does not; called Date.parse with a leap second generates an invalid date.
The solution is to simply re-implement createFromIso8601 ourselves, making sure we handle all valid date specifications. This eliminates the middle-man Date approach and maintains accuracy and leap seconds. I've added a test to Core/JulianDateSpec.js, "Construct a date from ISO8601 on a leap second.", which is currently ignored with xit that shows the problem.