diff --git a/spec/calendar.html b/spec/calendar.html index 8e4f5e41e2..2653dec283 100644 --- a/spec/calendar.html +++ b/spec/calendar.html @@ -452,18 +452,6 @@

ISODaysInMonth ( _year_, _month_ )

- -

ToISODayOfWeek ( _year_, _month_, _day_ )

- - 1. Assert: _year_ is an integer. - 1. Assert: _month_ is an integer. - 1. Assert: _day_ is an integer. - 1. Let _date_ be the date given by _year_, _month_, and _day_. - 1. Return _date_'s day of the week according to ISO-8601 as an integer. - - Monday is 1 and Sunday is 7. -
-

ToISOWeekOfYear ( _year_, _month_, _day_ )

@@ -959,7 +947,11 @@

Temporal.Calendar.prototype.dayOfWeek ( _temporalDateLike_ )

1. Perform ? RequireInternalSlot(_calendar_, [[InitializedTemporalCalendar]]). 1. Assert: _calendar_.[[Identifier]] is *"iso8601"*. 1. Let _temporalDate_ be ? ToTemporalDate(_temporalDateLike_). - 1. Return 𝔽(! ToISODayOfWeek(_temporalDate_.[[ISOYear]], _temporalDate_.[[ISOMonth]], _temporalDate_.[[ISODay]])). + 1. Let _epochDays_ be MakeDay(𝔽(_temporalDate_.[[ISOYear]]), 𝔽(_temporalDate_.[[ISOMonth]] - 1), 𝔽(_temporalDate_.[[ISODay]])). + 1. Assert: _epochDays_ is finite. + 1. Let _dayOfWeek_ be WeekDay(MakeDate(_epochDays_, *+0*𝔽)). + 1. If _dayOfWeek_ = *+0*𝔽, return *7*𝔽. + 1. Return _dayOfWeek_.
diff --git a/spec/intl.html b/spec/intl.html index 455adec611..d053940373 100644 --- a/spec/intl.html +++ b/spec/intl.html @@ -1852,9 +1852,12 @@

Temporal.Calendar.prototype.dayOfWeek ( _dateOrDateTime_ )

1. Perform ? RequireInternalSlot(_calendar_, [[InitializedTemporalCalendar]]). 1. Let _temporalDate_ be ? ToTemporalDate(_temporalDateLike_). 1. If _calendar_.[[Identifier]] is *"iso8601"*, then - 1. Let _dayOfWeek_ be ! ToISODayOfWeek(_temporalDate_.[[ISOYear]], _temporalDate_.[[ISOMonth]], _temporalDate_.[[ISODay]]). - 1. Else, - 1. Let _dayOfWeek_ be ! CalendarDateDayOfWeek(_calendar_.[[Identifier]], _temporalDate_). + 1. Let _epochDays_ be MakeDay(𝔽(_temporalDate_.[[ISOYear]]), 𝔽(_temporalDate_.[[ISOMonth]] - 1), 𝔽(_temporalDate_.[[ISODay]])). + 1. Assert: _epochDays_ is finite. + 1. Let _dayOfWeek_ be WeekDay(MakeDate(_epochDays_, *+0*𝔽)). + 1. If _dayOfWeek_ = *+0*𝔽, return *7*𝔽. + 1. Return _dayOfWeek_. + 1. Let _dayOfWeek_ be ! CalendarDateDayOfWeek(_calendar_.[[Identifier]], _temporalDate_). 1. Return 𝔽(_dayOfWeek_).