Feedback from code review

This commit is contained in:
Tim Chevalier 2024-10-30 16:44:16 -07:00 committed by Philip Chimento
parent bfb957f669
commit 87344d96f2
3 changed files with 27 additions and 18 deletions

View File

@ -8,16 +8,6 @@ includes: [temporalHelpers.js]
features: [Temporal]
---*/
// subtract result
// var later = Temporal.ZonedDateTime.from("2019-10-29T10:46:38.271986102-03:00[-03:00]");
var later = new Temporal.ZonedDateTime(1572356798271986102n, "-03:00");
var earlier = later.subtract({ hours: 12 });
TemporalHelpers.assertZonedDateTimesEqual(
earlier,
// "2019-10-28T22:46:38.271986102-03:00[-03:00]"
new Temporal.ZonedDateTime(1572313598271986102n, "-03:00"));
// add result
// earlier = Temporal.ZonedDateTime.from("2020-05-31T23:12:38.271986102-04:00[-04:00]");
earlier = new Temporal.ZonedDateTime(1590981158271986102n, "-04:00");
@ -34,10 +24,3 @@ earlier = new Temporal.ZonedDateTime(1572313598271986102n, "-03:00");
// symmetrical with regard to negative durations
TemporalHelpers.assertZonedDateTimesEqual(later.add({ hours: -12 }), earlier);
// "2020-05-31T23:12:38.271986102-04:00[-04:00]"
earlier = new Temporal.ZonedDateTime(1590981158271986102n, "-04:00");
later = new Temporal.ZonedDateTime(1590988358271986102n, "-04:00");
TemporalHelpers.assertZonedDateTimesEqual(earlier.subtract({ hours: -2 }), later);

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.zoneddatetime.prototype.equals
description: Different time zones not equal.
description: equals() casts its argument from string or object.
features: [Temporal]
---*/

View File

@ -0,0 +1,26 @@
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.zoneddatetime.prototype.subtract
description: Hours overflow.
includes: [temporalHelpers.js]
features: [Temporal]
---*/
// subtract result
// var later = Temporal.ZonedDateTime.from("2019-10-29T10:46:38.271986102-03:00[-03:00]");
var later = new Temporal.ZonedDateTime(1572356798271986102n, "-03:00");
var earlier = later.subtract({ hours: 12 });
TemporalHelpers.assertZonedDateTimesEqual(
earlier,
// "2019-10-28T22:46:38.271986102-03:00[-03:00]"
new Temporal.ZonedDateTime(1572313598271986102n, "-03:00"));
// "2020-05-31T23:12:38.271986102-04:00[-04:00]"
earlier = new Temporal.ZonedDateTime(1590981158271986102n, "-04:00");
later = new Temporal.ZonedDateTime(1590988358271986102n, "-04:00");
TemporalHelpers.assertZonedDateTimesEqual(earlier.subtract({ hours: -2 }), later);