A conversion of d3-time to use the in-progress Temporal proposal instead of the legacy Date object.
In most places I've attempted to make the minimum amount of changes to make it work, and preserve the d3 code style. The one big deviation from that goal was the creation of a factory method to make most definitions much simpler. This was only possible after converting everything to Temporal.DateTime, at which point the method definitions were much more similar and repetitive.
- All
d3-timemethods have been altered to only take and returnTemporal.DateTimeobjects. These are abstract, immutable objects with no fixed time zone. No raw numbers representing milliseconds, no legacyDateobjects. - Due to the abstract nature of
Temporal.DateTime, allutc*methods (d3.time.utcYear(),d3.time.utcMonth(), etc.) have been made aliases of the non-UTC versions. To useTemporal.DateTimewith UTC or local time (or any other time zone), call the.toInstant(timeZone)method.
See the full list of commits for step-by-step conversion details.