From c61a04fd8833e9b4be5da1d9e712a50de85343ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 1 Jun 2022 17:03:41 +0200 Subject: [PATCH] AddDurationToOrSubtractDurationFromPlainYearMonth doesn't add "month" to calendar fields Fixes #3546 --- .../prototype/add/calendar-datefromfields-called.js | 8 ++++---- .../prototype/subtract/calendar-datefromfields-called.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-datefromfields-called.js b/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-datefromfields-called.js index 40f5dd1b73..356c59a60d 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-datefromfields-called.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/add/calendar-datefromfields-called.js @@ -105,7 +105,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 1 }, + { year: 2022, monthCode: "M02", day: 1 }, "first day of month 2 passed to dateFromFields when adding positive duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -120,7 +120,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 1 }, + { year: 2022, monthCode: "M02", day: 1 }, "first day of month 2 passed to dateFromFields when adding positive duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -135,7 +135,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 36 }, + { year: 2022, monthCode: "M02", day: 36 }, "last day of month 2 passed to dateFromFields when adding negative duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -150,7 +150,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 36 }, + { year: 2022, monthCode: "M02", day: 36 }, "last day of month 2 passed to dateFromFields when adding negative duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-datefromfields-called.js b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-datefromfields-called.js index fda7e4bbac..91ed2c46da 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-datefromfields-called.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/calendar-datefromfields-called.js @@ -105,7 +105,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 36 }, + { year: 2022, monthCode: "M02", day: 36 }, "last day of month 2 passed to dateFromFields when subtracting positive duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -120,7 +120,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 36 }, + { year: 2022, monthCode: "M02", day: 36 }, "last day of month 2 passed to dateFromFields when subtracting positive duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -135,7 +135,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 1 }, + { year: 2022, monthCode: "M02", day: 1 }, "first day of month 2 passed to dateFromFields when subtracting negative duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed"); @@ -150,7 +150,7 @@ TemporalHelpers.assertPlainYearMonth( assert.sameValue(calendar.dateFromFieldsCalls.length, 1, "dateFromFields was called"); assert.deepEqual( calendar.dateFromFieldsCalls[0][0], - { year: 2022, month: 2, monthCode: "M02", day: 1 }, + { year: 2022, monthCode: "M02", day: 1 }, "first day of month 2 passed to dateFromFields when subtracting negative duration" ); assert.sameValue(calendar.dateFromFieldsCalls[0][1], undefined, "undefined options passed");