Skip to content

The locales parameter of DateTimeFormat and NumberFormat should be optional #384

Closed
@OndrejSpanel

Description

@OndrejSpanel

class DateTimeFormat(locales: String | js.Array[String],

MDN says:

Locale identification and negotiation

The locales argument must be either a string holding a BCP 47 language tag, or an array of such language tags. If the locales argument is not provided or is undefined, the runtime's default locale is used.

And

DateTimeFormat:

new Intl.DateTimeFormat([locales[, options]])
Intl.DateTimeFormat.call(this[, locales[, options]])

Current signature of DateTimeFormat and NumberFormat is:

class DateTimeFormat(locales: String | js.Array[String],

In comparison. for Collator it is:

class Collator(locales: js.UndefOr[String | js.Array[String]] = js.undefined,

I think the same locales parameter type should be used for DateTimeFormat and NumberFormat.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions