mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibJS: Implement Temporal.PlainDate.prototype.monthsInYear
This commit is contained in:
parent
342172da37
commit
dd15fc471c
5 changed files with 43 additions and 0 deletions
|
@ -263,6 +263,16 @@ Value calendar_days_in_year(GlobalObject& global_object, Object& calendar, Objec
|
|||
return calendar.invoke(vm.names.daysInYear, &date_like);
|
||||
}
|
||||
|
||||
// 12.1.19 CalendarMonthsInYear ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarmonthsinyear
|
||||
Value calendar_months_in_year(GlobalObject& global_object, Object& calendar, Object& date_like)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
// 1. Assert: Type(calendar) is Object.
|
||||
|
||||
// 2. Return ? Invoke(calendar, "monthsInYear", « dateLike »).
|
||||
return calendar.invoke(vm.names.monthsInYear, &date_like);
|
||||
}
|
||||
|
||||
// 12.1.21 ToTemporalCalendar ( temporalCalendarLike ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalcalendar
|
||||
Object* to_temporal_calendar(GlobalObject& global_object, Value temporal_calendar_like)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue