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

  1. nekevss commented on Feb 26, 2026

    @nekevss
    Member

    Ah, that's probably from parsing the calendar as an ICU locale value here.

  2. added theissue type on Mar 5, 2026
  3. added this to the v1.0 blocking milestone on Mar 11, 2026
  4. Manishearth commented on Mar 17, 2026

    @Manishearth
    Contributor

    This is fixed by unicode-org/icu4x#7477

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