@@ -3301,12 +3301,12 @@ function BalanceTime(
3301
3301
3302
3302
export function TotalDurationNanoseconds (
3303
3303
daysParam : number ,
3304
- hoursParam : number ,
3305
- minutesParam : number ,
3306
- secondsParam : number ,
3307
- millisecondsParam : number ,
3308
- microsecondsParam : number ,
3309
- nanosecondsParam : number ,
3304
+ hoursParam : number | JSBI ,
3305
+ minutesParam : number | JSBI ,
3306
+ secondsParam : number | JSBI ,
3307
+ millisecondsParam : number | JSBI ,
3308
+ microsecondsParam : number | JSBI ,
3309
+ nanosecondsParam : number | JSBI ,
3310
3310
offsetShift : number
3311
3311
) {
3312
3312
const days : JSBI = JSBI . BigInt ( daysParam ) ;
@@ -3407,12 +3407,12 @@ function NanosecondsToDays(nanosecondsParam: JSBI, relativeTo: ReturnType<typeof
3407
3407
3408
3408
export function BalanceDuration (
3409
3409
daysParam : number ,
3410
- hoursParam : number ,
3411
- minutesParam : number ,
3412
- secondsParam : number ,
3413
- millisecondsParam : number ,
3414
- microsecondsParam : number ,
3415
- nanosecondsParam : number ,
3410
+ hoursParam : number | JSBI ,
3411
+ minutesParam : number | JSBI ,
3412
+ secondsParam : number | JSBI ,
3413
+ millisecondsParam : number | JSBI ,
3414
+ microsecondsParam : number | JSBI ,
3415
+ nanosecondsParam : number | JSBI ,
3416
3416
largestUnit : Temporal . DateTimeUnit ,
3417
3417
relativeTo : ReturnType < typeof ToRelativeTemporalObject > = undefined
3418
3418
) {
@@ -3436,12 +3436,12 @@ export function BalanceDuration(
3436
3436
3437
3437
export function BalancePossiblyInfiniteDuration (
3438
3438
daysParam : number ,
3439
- hoursParam : number ,
3440
- minutesParam : number ,
3441
- secondsParam : number ,
3442
- millisecondsParam : number ,
3443
- microsecondsParam : number ,
3444
- nanosecondsParam : number ,
3439
+ hoursParam : number | JSBI ,
3440
+ minutesParam : number | JSBI ,
3441
+ secondsParam : number | JSBI ,
3442
+ millisecondsParam : number | JSBI ,
3443
+ microsecondsParam : number | JSBI ,
3444
+ nanosecondsParam : number | JSBI ,
3445
3445
largestUnit : Temporal . DateTimeUnit ,
3446
3446
relativeTo : ReturnType < typeof ToRelativeTemporalObject > = undefined
3447
3447
) {
@@ -4865,12 +4865,12 @@ function AddDuration(
4865
4865
years = months = weeks = 0 ;
4866
4866
( { days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds } = BalanceDuration (
4867
4867
d1 + d2 ,
4868
- h1 + h2 ,
4869
- min1 + min2 ,
4870
- s1 + s2 ,
4871
- ms1 + ms2 ,
4872
- µs1 + µs2 ,
4873
- ns1 + ns2 ,
4868
+ JSBI . add ( JSBI . BigInt ( h1 ) , JSBI . BigInt ( h2 ) ) ,
4869
+ JSBI . add ( JSBI . BigInt ( min1 ) , JSBI . BigInt ( min2 ) ) ,
4870
+ JSBI . add ( JSBI . BigInt ( s1 ) , JSBI . BigInt ( s2 ) ) ,
4871
+ JSBI . add ( JSBI . BigInt ( ms1 ) , JSBI . BigInt ( ms2 ) ) ,
4872
+ JSBI . add ( JSBI . BigInt ( µs1 ) , JSBI . BigInt ( µs2 ) ) ,
4873
+ JSBI . add ( JSBI . BigInt ( ns1 ) , JSBI . BigInt ( ns2 ) ) ,
4874
4874
largestUnit
4875
4875
) ) ;
4876
4876
} else if ( IsTemporalDate ( relativeTo ) ) {
@@ -4890,12 +4890,12 @@ function AddDuration(
4890
4890
// Signs of date part and time part may not agree; balance them together
4891
4891
( { days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds } = BalanceDuration (
4892
4892
days ,
4893
- h1 + h2 ,
4894
- min1 + min2 ,
4895
- s1 + s2 ,
4896
- ms1 + ms2 ,
4897
- µs1 + µs2 ,
4898
- ns1 + ns2 ,
4893
+ JSBI . add ( JSBI . BigInt ( h1 ) , JSBI . BigInt ( h2 ) ) ,
4894
+ JSBI . add ( JSBI . BigInt ( min1 ) , JSBI . BigInt ( min2 ) ) ,
4895
+ JSBI . add ( JSBI . BigInt ( s1 ) , JSBI . BigInt ( s2 ) ) ,
4896
+ JSBI . add ( JSBI . BigInt ( ms1 ) , JSBI . BigInt ( ms2 ) ) ,
4897
+ JSBI . add ( JSBI . BigInt ( µs1 ) , JSBI . BigInt ( µs2 ) ) ,
4898
+ JSBI . add ( JSBI . BigInt ( ns1 ) , JSBI . BigInt ( ns2 ) ) ,
4899
4899
largestUnit
4900
4900
) ) ;
4901
4901
} else {
@@ -4964,7 +4964,15 @@ function AddDuration(
4964
4964
return { years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds } ;
4965
4965
}
4966
4966
4967
- function AddInstant ( epochNanoseconds : JSBI , h : number , min : number , s : number , ms : number , µs : number , ns : number ) {
4967
+ function AddInstant (
4968
+ epochNanoseconds : JSBI ,
4969
+ h : number | JSBI ,
4970
+ min : number | JSBI ,
4971
+ s : number | JSBI ,
4972
+ ms : number | JSBI ,
4973
+ µs : number | JSBI ,
4974
+ ns : number | JSBI
4975
+ ) {
4968
4976
let sum = ZERO ;
4969
4977
sum = JSBI . add ( sum , JSBI . BigInt ( ns ) ) ;
4970
4978
sum = JSBI . add ( sum , JSBI . multiply ( JSBI . BigInt ( µs ) , THOUSAND ) ) ;
@@ -5046,12 +5054,12 @@ export function AddZonedDateTime(
5046
5054
months : number ,
5047
5055
weeks : number ,
5048
5056
days : number ,
5049
- h : number ,
5050
- min : number ,
5051
- s : number ,
5052
- ms : number ,
5053
- µs : number ,
5054
- ns : number ,
5057
+ h : number | JSBI ,
5058
+ min : number | JSBI ,
5059
+ s : number | JSBI ,
5060
+ ms : number | JSBI ,
5061
+ µs : number | JSBI ,
5062
+ ns : number | JSBI ,
5055
5063
options ?: Temporal . ArithmeticOptions
5056
5064
) {
5057
5065
// If only time is to be added, then use Instant math. It's not OK to fall
0 commit comments