diff --git a/polyfill/lib/ecmascript.mjs b/polyfill/lib/ecmascript.mjs index d02519dc97..2f4541e15a 100644 --- a/polyfill/lib/ecmascript.mjs +++ b/polyfill/lib/ecmascript.mjs @@ -1186,6 +1186,21 @@ export const ES = ObjectAssign({}, ES2020, { let year, month, day, hour, minute, second, millisecond, microsecond, nanosecond, calendar; if (ES.Type(item) === 'Object') { if (ES.IsTemporalDateTime(item)) return item; + if (ES.IsTemporalDate(item)) { + const TemporalPlainDateTime = GetIntrinsic('%Temporal.PlainDateTime%'); + return new TemporalPlainDateTime( + GetSlot(item, ISO_YEAR), + GetSlot(item, ISO_MONTH), + GetSlot(item, ISO_DAY), + 0, + 0, + 0, + 0, + 0, + 0, + GetSlot(item, CALENDAR) + ); + } calendar = item.calendar; if (calendar === undefined) calendar = ES.GetISO8601Calendar(); diff --git a/spec/plaindatetime.html b/spec/plaindatetime.html index 3697202ee2..d172d41f1b 100644 --- a/spec/plaindatetime.html +++ b/spec/plaindatetime.html @@ -903,6 +903,8 @@