diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs index 640cb40592..28b4357245 100644 --- a/polyfill/lib/ecmascript.mjs +++ b/polyfill/lib/ecmascript.mjs @@ -1496,7 +1496,7 @@ export const ES = ObjectAssign({}, ES2020, { } // "prefer" or "reject" - const possibleInstants = timeZone.getPossibleInstantsFor(dt); + const possibleInstants = ES.GetPossibleInstantsFor(timeZone, dt); for (const candidate of possibleInstants) { const candidateOffset = ES.GetOffsetNanosecondsFor(timeZone, candidate); if (candidateOffset === offsetNs) return GetSlot(candidate, EPOCHNANOSECONDS); @@ -2051,7 +2051,7 @@ export const ES = ObjectAssign({}, ES2020, { GetPossibleInstantsFor: (timeZone, dateTime) => { let getPossibleInstantsFor = ES.GetMethod(timeZone, 'getPossibleInstantsFor'); const possibleInstants = ES.Call(getPossibleInstantsFor, timeZone, [dateTime]); - const result = ES.CreateListFromArrayLike(possibleInstants, ['Object']); + const result = [...possibleInstants]; const numInstants = result.length; for (let ix = 0; ix < numInstants; ix++) { if (!ES.IsTemporalInstant(result[ix])) { @@ -3844,6 +3844,7 @@ export const ES = ObjectAssign({}, ES2020, { }, MoveRelativeDate: (calendar, relativeTo, duration) => { const later = ES.CalendarDateAdd(calendar, relativeTo, duration, {}); + relativeTo = ES.ToTemporalDateTime(relativeTo); const days = ES.DaysUntil(relativeTo, later); relativeTo = ES.CreateTemporalDateTime( GetSlot(later, ISO_YEAR), diff --git a/spec/timezone.html b/spec/timezone.html index 33da16b8fe..6c0230dbf8 100644 --- a/spec/timezone.html +++ b/spec/timezone.html @@ -626,7 +626,7 @@