tc39 / proposal-intl-datetime-style

dateStyle and timeStyle options for DateTimeFormat
https://tc39.github.io/proposal-intl-datetime-style/
28 stars 9 forks source link

Inconsistent range of dateStyle and timeStyle and lack of undefined as default #14

Closed FrankYFTang closed 5 years ago

FrankYFTang commented 5 years ago

In the current spect, the range of dateStyle and timeStyle is inconsistent in several places. I saw TWO different set: A. "full", "long", "medium", "short" A-1. In https://tc39.github.io/proposal-intl-datetime-style/#sec-initializedatetimeformat Step 28 and 30 A-2 https://tc39.github.io/proposal-intl-datetime-style/#sec-properties-of-intl-datetimeformat-instances

AND another set B. "full", "long", "short" or "narrow" B-1 https://tc39.github.io/proposal-intl-datetime-style/#sec-date-time-style-pattern intro text, Step 1-a, 2-a,

So... which set should we use? A or B?

Also, In https://tc39.github.io/proposal-intl-datetime-style/#sec-initializedatetimeformat Step 28 and 30, the default argument GetOptions should be given. Currently

  1. Let dateStyle be ? GetOption(options, "dateStyle", "string", « "full", "long", "medium", "short" »). ...
  2. Let timeStyle be ? GetOption(options, "timeStyle", "string", « "full", "long", "medium", "short" »). it should be
  3. Let dateStyle be ? GetOption(options, "dateStyle", "string", « "full", "long", "medium", "short" », undefined). ...
  4. Let timeStyle be ? GetOption(options, "timeStyle", "string", « "full", "long", "medium", "short" », undefined).
FrankYFTang commented 5 years ago

@zbraniecki @littledan

zbraniecki commented 5 years ago

I followed CLDR's "full", "long", "medium", "short". http://www.unicode.org/cldr/charts/34/summary/pl.html#2141

littledan commented 5 years ago

Yep, the mistake was mine! Thanks for fixing this, @FrankYFTang , in #16 .