GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Temporal on v26.x: until() and round() add one smallestUnit to a whole number of years, months or weeks (temporal_rs 0.2.3) · Issue #67457 · nodejs/node Open DescriptionVersionv26.13.1 (V8 14.6.202.34-node.40). Also v26.12.1 and v26.13.0. PlatformSubsystemtemporal, deps/crates (temporal_rs) What steps will reproduce the bug?const start = Temporal.PlainDate.from("2000-01-01"); const opts = (roundingMode, smallestUnit = "months") => ({ largestUnit: "years", smallestUnit, roundingMode }); console.log(start.until("2001-01-01", opts("halfExpand")).toString()); console.log(start.until("2003-01-01", opts("ceil")).toString()); console.log(start.until("2001-01-01", opts("ceil", "weeks")).toString()); console.log(Temporal.Duration.from("P31D").round({ largestUnit: "months", smallestUnit: "weeks", roundingMode: "ceil", relativeTo: "2012-01-01" }).toString()); console.log(Temporal.Duration.from("P7D").round({ largestUnit: "weeks", smallestUnit: "days", relativeTo: "2024-11-01T00:00:00+00:00[UTC]" }).toString()); How often does it reproduce? Is there a required condition?Every time the result is a whole number of a larger unit, so the smallest unit comes out as 0, What is the expected behavior? Why is that the expected behavior?Each end is exactly one or three years, one month or one week after the start, so there is nothing left to round up. Chromium 153.0.8010.12 and WebKit 26.6 print these five lines. What do you see instead?Each result has one extra unit of Additional informationThe cause is in temporal_rs 0.2.3, which
Edited 2026-11-13: narrowed "How often" to the cases that give a wrong result. Activity
MetadataMetadata |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |