Skip to content

Incorrect handling of calendar names during parsing #682

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions