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 — duration() shows wrong days and hours past 24h · Issue #32956 · anomalyco/opencode

duration() shows wrong days and hours past 24h #32956

New issue
Copy link
New issue
Copy link
Closed
#33651
Closed
duration() shows wrong days and hours past 24h#32956
#33651
Copy link
Assignees
simonklee

Description

@itsybitsybootsy
itsybitsybootsy
opened on Jun 19, 2026
Issue body actions

Description

duration() in packages/tui/src/util/locale.ts gets the days/hours branch wrong once a duration reaches 24h.

It computes days from the sub-hour remainder (input % 3600000) divided by a full day, which is always 0, and leaves hours as the uncapped total:

const hours = Math.floor(input / 3600000)               // total hours, never capped
const days  = Math.floor((input % 3600000) / 86400000)  // always 0

So:

  • 1 day → 0d 24h (expected 1d 0h)
  • 2d 3h → 0d 51h (expected 2d 3h)

It's used to show elapsed time in the TUI session view, where a span is completed - created over a whole session or subagent, so anything that ran 24h or longer shows a nonsensical value.

OpenCode version

dev (1.17.8)

Steps to reproduce

duration(86400000)   // "0d 24h", expected "1d 0h"
duration(183600000)  // "0d 51h", expected "2d 3h"

Activity

  1. github-actions
    assigned
    simonklee
    on Jun 19, 2026
  2. Robin1987China
    added a commit that references this issue on Jun 22, 2026

    fix(tui): correct duration() days/hours calculation past 24h

    This issue will close once commit 829ea1e is merged into the 'dev' branch.
    829ea1e
  3. simonklee
    closed this as completedin 6281e35on Jun 24, 2026
  4. BenGu3
    added a commit that references this issue on Jun 27, 2026

    tui: fix multi-day duration formatting (anomalyco#33651)

    This issue will close once commit 1c9fb58 is merged into the 'dev' branch.
    1c9fb58
  5. lacymorrow
    added a commit that references this issue on Jun 29, 2026

    sync: merge upstream/dev catch-up (629 commits) (#31)

    This issue will close once commit 2602aff is merged into the 'lash' branch.
    2602aff
  6. LuisAlbertoMK
    added a commit that references this issue on Jul 6, 2026

    tui: fix multi-day duration formatting (anomalyco#33651)

    This issue will close once commit 431f746 is merged into the 'dev' branch.
    431f746
  7. lacymorrow
    added a commit that references this issue on Jul 9, 2026

    fix(test): resolve shell/cwd unit-test failures surfaced by GitHub-ho…

    This issue will close once commit e3cb8f7 is merged into the 'lash' branch.
    e3cb8f7
  8. MarsQiu007
    added a commit that references this issue on Jul 31, 2026

    tui: fix multi-day duration formatting (#33651)

    This issue will close once commit 8ad4848 is merged into the 'main' branch.
    8ad4848
  9. rldona
    added a commit that references this issue on Sep 24, 2026

    tui: fix multi-day duration formatting (anomalyco#33651)

    This issue will close once commit 4dbd289 is merged into the 'main' branch.
    4dbd289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @simonklee
    simonklee

Labels

No labels
No labels

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.