GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

Temporal on v26.x: until() and round() add one smallestUnit to a whole number of years, months or weeks (temporal_rs 0.2.3) #67457

New issue
Copy link
New issue
Copy link
Open
Open
Temporal on v26.x: until() and round() add one smallestUnit to a whole number of years, months or weeks (temporal_rs 0.2.3)#67457
Copy link
Labels
v26.xIssues that can be reproduced on v26.x or PRs targeting the v26.x-staging branch.v8 engineIssues and PRs related to the V8 dependency.

Description

@craig-o-curtis
craig-o-curtis
opened on Nov 13, 2026
Issue body actions

Version

v26.13.1 (V8 14.6.202.34-node.40). Also v26.12.1 and v26.13.0.

Platform

Darwin 27.0.0 arm64

Subsystem

temporal, 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, smallestUnit is months or weeks (or days from a ZonedDateTime), and the rounding mode can round up (ceil, expand or one of the half modes). trunc and floor give the right result, and so does smallestUnit: "days" from a PlainDate or PlainDateTime. PlainDateTime, ZonedDateTime and since are affected in the same way, in every calendar.

What is the expected behavior? Why is that the expected behavior?

P1Y
P3Y
P1Y
P1M
P1W

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?

P1Y1M
P3Y1M
P1Y1W
P1M1W
P1W1D

Each result has one extra unit of smallestUnit.

Additional information

The cause is in temporal_rs 0.2.3, which deps/crates/Cargo.toml pins on v26.x. When it builds the rounding window, it checks only whether the smallest unit is 0, not whether the whole duration is 0, so the window starts at the origin instead of at the end of the whole years, months or weeks.

  • Spec: Shady results when rounding duration with smallestUnit/largestUnit tc39/proposal-temporal#3316, fixed by Polyfill: Fix detection of bounding window start tc39/proposal-temporal#3319.
  • test262: tc39/test262@a70493e adds exact-multiple-of-larger-unit*.js for Duration.prototype.round and for since and until on PlainDate, PlainDateTime, PlainYearMonth and ZonedDateTime.
  • temporal_rs: Fix ComputeNudgeWindow startEpochNs computation to check full startDateDuration sign boa-dev/temporal#723, first released in 0.2.4.

main pins 0.2.6, which has the fix. Could v26.x move to temporal_rs 0.2.4 or later, the way #64543 brought it to 0.2.3, or take boa-dev/temporal#723 on its own? The change is in compute_nudge_window in src/builtins/core/duration/normalized.rs.

Edited 2026-11-13: narrowed "How often" to the cases that give a wrong result.

Activity

  1. craig-o-curtis
    added a commit that references this issue on Nov 13, 2026

    docs(upstream): record every upstream filing, and probe for tc39 #332…

    0e4ad43
  2. tanveer-arch commented on Nov 14, 2026

    @tanveer-arch
    tanveer-arch
    on Nov 14, 2026
    More actions

    I'd like to take this on. The repro is clear: until() on a whole number of years returns an extra smallestUnit (1 year 1 month instead of 1 year). I'm looking into the rounding logic in the vendored temporal_rs crate and will open a PR with a fix.

  3. inoway46
    added
    v8 engineIssues and PRs related to the V8 dependency.
    on Nov 14, 2026
  4. Renegade334 commented on Nov 14, 2026

    @Renegade334
    Renegade334
    on Nov 14, 2026
    Member
    More actions

    temporal_rs 0.2.4 is compatible with V8 14.6, so a drop-in replacement is perfectly feasible.

    There haven't been any spec changes since that release, so hopefully we should be able to leave this alone from here... 🤞

  5. Renegade334
    added
    v26.xIssues that can be reproduced on v26.x or PRs targeting the v26.x-staging branch.
    on Nov 14, 2026
  6. craig-o-curtis
    added a commit that references this issue on Nov 15, 2026

    fix(core): right years and complete ranges in formatted dates; add th…

    ba5fe2b
  7. Renegade334
    linked a pull request that will close this issue[v26.x] deps: update temporal_rs to 0.2.4 #67474on Nov 16, 2026
  8. aduh95
    added 2 commits that reference this issue on Nov 19, 2026

    deps: V8: cherry-pick third_party/rust update from cce7146a7a2a

    408a64d

    deps: update Rust crates for V8 14.6.202.34-node.40

    b432527
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    v26.xIssues that can be reproduced on v26.x or PRs targeting the v26.x-staging branch.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.