boa-dev / temporal

A Rust implementation of ECMAScript's Temporal API
Apache License 2.0
26 stars 4 forks source link

Updates to instant and its methods #85

Closed nekevss closed 4 months ago

nekevss commented 4 months ago

This PR updates Instant to some of the newer specification changes.

TLDR of the below:

Primarily, it brings since and until up to date with both temporal_rs and the specification as a whole (along with at least 2 basic tests for since and until)

This PR also changes Instant inner nanoseconds from BigInt to i128. My thought is to eventually remove all usage of BigInt from temporal_rs in general. Primarily motivated by the thought that if NormalizedTimeDuration is using a i128, I don't see a huge reason why Instant should differ, unless I'm overlooking something and someone thinks otherwise.

Finally, it implements FromStr for Instant. This will allow parsing of JsString in Boa, and would unblock to_temporal_instant.