tc39 / proposal-temporal

Provides standard objects and functions for working with dates and times.
https://tc39.es/proposal-temporal/docs/
Other
3.32k stars 150 forks source link

Docs vs. spec/polyfill mismatch for type of `calendar` and `timeZone` params of constructors #1436

Closed justingrant closed 7 months ago

justingrant commented 3 years ago

The docs say that the calendar and timeZone arguments to Temporal constructors must be an object. Example:

  • timeZone (Temporal.TimeZone or plain object): The time zone in which the event takes place.
  • calendar (optional Temporal.Calendar or plain object): Calendar used to interpret dates and times. Usually set to 'iso8601'.

But the spec and the polyfill can also accept a string. Repro:

new Temporal.PlainDate(2000, 1, 1, 'chinese');
// => 2000-01-01[u-ca-chinese]

I assume the spec and polyfill are correct and the docs are wrong. True?

ptomato commented 3 years ago

Yes, this should be updated in the documentation.

ptomato commented 7 months ago

This has been fixed in the meantime.