Skip to content

spec: should ParseTemporalCalendarString AO accept strings such as "2026-01[u-ca=gregory]" or "01-01[u-ca=gregory]"? #3237

@fabon-f

Description

@fabon-f

EDIT: I misunderstood the actual problem, edited the issue comment completely.

As far as I read the spec, "2026-01" is a valid string for TemporalTimeString, because it can be parsed as Time (hour and minute without :) followed by negative DateTimeUTCOffset (i.e. T20:26:00-01:00). Similarly "01-01" can be parsed as well as "T01:00-01:00".

This format is explicitly rejected in ToTemporalTime (because it matches to AmbiguousTemporalTimeString), but not in ParseTemporalCalendarString and ParseTemporalTimeZoneString. Is this an intended behavior?

// error in SpiderMonkey and V8, but the reference polyfill returns `PlainDate` with Gregorian calendar
Temporal.Now.plainDateISO().withCalendar('01-01[u-ca=gregory]')

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