mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
LibJS: Fix logic typo in balance_duration() hours calculation
By using milliseconds_division_result instead of seconds_division_result here, the result for hours was off by a factor of 60.
This commit is contained in:
parent
b97f9f8e17
commit
f0cd727d74
3 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@ describe("correct behavior", () => {
|
|||
const instant1 = new Temporal.Instant(1625614920000000000n);
|
||||
const instant2 = new Temporal.Instant(0n);
|
||||
expect(instant1.since(instant2).seconds).toBe(1625614920);
|
||||
expect(instant1.since(instant2, { largestUnit: "hour" }).hours).toBe(27093582);
|
||||
expect(instant1.since(instant2, { largestUnit: "hour" }).hours).toBe(451559);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ describe("correct behavior", () => {
|
|||
const instant1 = new Temporal.Instant(0n);
|
||||
const instant2 = new Temporal.Instant(1625614920000000000n);
|
||||
expect(instant1.until(instant2).seconds).toBe(1625614920);
|
||||
expect(instant1.until(instant2, { largestUnit: "hour" }).hours).toBe(27093582);
|
||||
expect(instant1.until(instant2, { largestUnit: "hour" }).hours).toBe(451559);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue