Skip to content

Bug: Malformed leap month suffix while implementing Chinese calendar #360

@pattishin

Description

@pattishin

Browser: Safari 26.4

Polyfill cdn: https://esm.sh/@js-temporal/polyfill

Issue: I'm leveraging this polyfill for a chinese calendar I am implementing to also include the leap year functionality from Temporal. The error I came across was Error: Unexpected leap month suffix: Mo3.

To recreate:

const today = (Temporal.Now.plainDateISO()).toString();
const date = Temporal.PlainDate.from(today);
const chineseDate = date.withCalendar('chinese');

// Calling chineseDate.year, chineseDate.month, chinese.monthCode, chineseDate.monthsInYear recreates the error

It seems like a malformed month code issue stemming from

if (monthExtra !== undefined) throw new RangeError('Unexpected `monthExtra` value');

Any help or direction would be much appreciated!

Screenshots of the error:

Screenshot 2026-04-21 at 10 47 38 PM Screenshot 2026-04-21 at 10 45 32 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions