Skip to content

Incorrect handling of calendar names during parsing #682

@fabon-f

Description

@fabon-f
Temporal.PlainDate.from("2020-01-01[u-ca=gregory-foobar]");
// should raise an error, but returns "2020-01-01[u-ca=gregory]"
Temporal.PlainDate.from("2020-01-01[u-ca=persian-foobar]");
// ditto, "2020-01-01[u-ca=persian-foobar]"
Temporal.PlainDate.from("2020-01-01[u-ca=chinese-foobar]");
// ditto, "2020-01-01[u-ca=chinese]"
Temporal.PlainDate.from({ year: 2020, month: 1, day: 1, calendar: "chinese-foobar" });
// ditto, "2020-01-25[u-ca=chinese]"

// "islamic" calendar is unsupported when a property bag is passed (which is spec-compliant),
// but doesn't raise an error during string parsing
Temporal.PlainDate.from("2020-01-01[u-ca=islamic]");
// "2020-01-01[u-ca=islamic-civil]"
// ditto for "islamic-rgsa"
Temporal.PlainDate.from("2020-01-01[u-ca=islamic-rgsa]");
// "2020-01-01"

I confirmed this bug in Chrome Canary and Boa (in playground).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions