Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Throw a RangeError when mixing date-/timeStyle with other date/time options #43

Merged
merged 5 commits into from
Apr 23, 2020

Conversation

anba
Copy link
Contributor

@anba anba commented Mar 31, 2020

Fixes #40.
Supersedes #41.

anba added 5 commits March 31, 2020 05:07
Don't add the date/time default values in ToDateTimeOptions when either
timeStyle or dateStyle is present.
…nused

This matches how other Intl service constructors work and to throw an error
when date-/timeStyle is used in conjunction with the other date/time options,
we need to retrieve the other options anyway.
… options

Drive-by change:
- Use standard EcmaSpeak when testing if both date- and timeStyle are undefined.

Fixes tc39#40.

Supersedes tc39#41.
@anba
Copy link
Contributor Author

anba commented Mar 31, 2020

There's still an open issue for how to handle things like date.toLocaleDateString("en", {timeStyle: "long"}). Also see #35, which is currently marked "editorial", but I don't think it's actually a purely editorial issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Idea about combining dateStyle/timeStyle with other options
2 participants