| // Copyright (C) 2021 Igalia, S.L. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| |
| /*--- |
| esid: sec-temporal.plaintime.prototype.add |
| description: Strings with fractional duration units are treated with the correct sign |
| includes: [temporalHelpers.js] |
| features: [Temporal] |
| ---*/ |
| |
| const instance = new Temporal.PlainTime(); |
| |
| const resultHours = instance.add("-PT24.567890123H"); |
| TemporalHelpers.assertPlainTime(resultHours, 23, 25, 55, 595, 557, 201, "negative fractional hours"); |
| |
| const resultMinutes = instance.add("-PT1440.567890123M"); |
| TemporalHelpers.assertPlainTime(resultMinutes, 23, 59, 25, 926, 592, 621, "negative fractional minutes"); |