LibJS: Implement Temporal.PlainYearMonth.prototype.until/since

This commit is contained in:
Timothy Flynn 2024-11-21 13:21:29 -05:00 committed by Andreas Kling
commit cb5d1b5086
Notes: github-actions[bot] 2024-11-22 18:56:30 +00:00
26 changed files with 1586 additions and 1 deletions

View file

@ -32,9 +32,17 @@ private:
String m_calendar; // [[Calendar]]
};
// 9.5.1 ISO Year-Month Records, https://tc39.es/proposal-temporal/#sec-temporal-iso-year-month-records
struct ISOYearMonth {
i32 year { 0 };
u8 month { 0 };
};
ThrowCompletionOr<GC::Ref<PlainYearMonth>> to_temporal_year_month(VM&, Value item, Value options = js_undefined());
bool iso_year_month_within_limits(ISODate);
ISOYearMonth balance_iso_year_month(double year, double month);
ThrowCompletionOr<GC::Ref<PlainYearMonth>> create_temporal_year_month(VM&, ISODate, String calendar, GC::Ptr<FunctionObject> new_target = {});
String temporal_year_month_to_string(PlainYearMonth const&, ShowCalendar);
ThrowCompletionOr<GC::Ref<Duration>> difference_temporal_plain_year_month(VM&, DurationOperation, PlainYearMonth const&, Value other, Value options);
}