1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibJS: Implement the rest of to_temporal_month_day()

Always throws at the moment, because parse_temporal_month_day_string()
is basically a stub, and parse_iso_date_time() isn't functional either.

The spec issue has been resolved though, so I figured we might as well
get one small step further :^)
This commit is contained in:
Linus Groh 2021-11-10 22:28:27 +00:00
parent 6ef1a2793f
commit fdffdc43fa
3 changed files with 57 additions and 4 deletions

View file

@ -78,6 +78,13 @@ struct TemporalYearMonth {
Optional<String> calendar = {};
};
struct TemporalMonthDay {
Optional<i32> year;
u8 month;
u8 day;
Optional<String> calendar = {};
};
struct TemporalZonedDateTime {
ISODateTime date_time;
TemporalTimeZone time_zone;
@ -123,6 +130,7 @@ ThrowCompletionOr<String> parse_temporal_calendar_string(GlobalObject&, String c
ThrowCompletionOr<TemporalDate> parse_temporal_date_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<ISODateTime> parse_temporal_date_time_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<TemporalDuration> parse_temporal_duration_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<TemporalMonthDay> parse_temporal_month_day_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<TemporalTime> parse_temporal_time_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<TemporalTimeZone> parse_temporal_time_zone_string(GlobalObject&, String const& iso_string);
ThrowCompletionOr<TemporalYearMonth> parse_temporal_year_month_string(GlobalObject&, String const& iso_string);