-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Labels
test262Issue related to test262 conformanceIssue related to test262 conformance
Description
TLDR: Temporal.PlainMonthDay.from("2025-06-01")
should work.
https://tc39.es/proposal-temporal/#prod-TemporalMonthDayString
When we parse a PlainMonthDay from a string, it is allowed to be specified as either an AnnotatedMonthDay
or an AnnotatedDateTime[~Zoned][~TimeRequired]
. It's similar for PlainTime and PlainYearMonth.
Currently we dispatch to individual parse functions:
Lines 690 to 695 in dc36a5b
let mut record = match variant { | |
ParseVariant::YearMonth => parser.parse_year_month_with_annotation_handler(handler), | |
ParseVariant::MonthDay => parser.parse_month_day_with_annotation_handler(handler), | |
ParseVariant::DateTime => parser.parse_with_annotation_handler(handler), | |
ParseVariant::Time => parser.parse_time_with_annotation_handler(handler), | |
} |
This is incorrect. We could probably unconditionally attempt to parse a date_time here and fall back to month_day/time/etc where necessary, but I don't know how to handle the TimeRequired/etc stuff here. Do we just check the parse result?
Metadata
Metadata
Assignees
Labels
test262Issue related to test262 conformanceIssue related to test262 conformance
Type
Projects
Status
Done