temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Update API for `temporalDateLike`, `temporalDurationLike`, etc. inputs

Open nekevss opened this issue 1 year ago • 1 comments

Currently, parameters on some calls differ a tad from specification. Instead of supporting a "Like" item, we take specific values. Ideally, these should be updated to the below.

  • temporalDateLike to Into<Date>
  • temporalDurationLike to Into<Duration>
  • temporalTimeZoneLike to Into<TimeZone>

nekevss avatar Jun 18 '24 00:06 nekevss

From https://github.com/boa-dev/temporal/pull/84#discussion_r1681400717:

I think the spec API is fine, but in my opinion the APIs should be adapted to the explicitness of Rust APIs instead of having a 1-1 equivalent in both, which in this case means having some function that people can call to get the calendar before calling the function, instead of filling the API with generics. This is partly because any APIs that have generics in them will make it really difficult to implement FFI interfaces for them.

jedel1043 avatar Jul 17 '24 17:07 jedel1043

Agreed with the above comment regarding minimizing generics in the API. Closing this issue as it is no longer needed.

nekevss avatar Jan 21 '25 02:01 nekevss