Skip to content

IsValidEraYearForCalendar: Don't check for minimum/maximum era year? #87

@anba

Description

@anba

This is supposed to work:

Temporal.PlainDate.from({calendar: "gregory", era: "ce", eraYear: -1, month: 1, day: 1}).toString()

But if I read IsValidEraYearForCalendar and NonISOCalendarDateToISO correctly, the current spec text requires a RangeError to be thrown from NonISOCalendarDateToISO?

NonISOCalendarDateToISO, step 1:

  1. If fields.[[Era]] and fields.[[EraYear]] are not unset, then
        a. If IsValidEraYearForCalendar(calendar, fields.[[Era]], fields.[[EraYear]]) is false, throw a RangeError exception.

IsValidEraYearForCalendar, steps 4-7:

  1. Let min be the value given in the "Minimum eraYear" column of r.
  2. Let max be the value given in the "Maximum eraYear" column of r.
  3. If eraYear < min, return false.
  4. If eraYear > max, return false.

Metadata

Metadata

Assignees

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