Skip to content

Bug: --since/--until silently ignore dashed YYYY-MM-DD dates #1108

Closed

Description

@Sim-hu

Description

--since and --until are documented as accepting either YYYY-MM-DD or YYYYMMDD (e.g. the agent guides under docs/guide/). The dashless form works, but the dashed form silently produces wrong results, with no error reported.

Steps to reproduce

With usage data spanning 2026-01-23 to 2026-05-20:

command rows returned expected
ccusage daily --since 20260315 29 29
ccusage daily --since 2026-03-15 39 (all rows) 29
ccusage daily --until 20260315 10 10
ccusage daily --until 2026-03-15 0 (empty) 10

So a dashed --since includes everything (the filter becomes a no-op) and a dashed --until excludes everything.

Cause

Date filtering compares entry dates with their dashes stripped (20260315) against the raw flag value. A dashed input is compared verbatim; since - (0x2D) sorts before the digits next to it, the lexicographic comparison flips. The same applies to since/until set via the config file.

Environment

  • ccusage Rust CLI v20.0.1

Activity

  1. github-actions commented on May 20, 2026

    @github-actions
    Contributor

    This issue was auto-closed. Issues from new contributors are auto-closed by default.

    Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.

    Keep the issue short, concrete, and written in your own voice.

    If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

    See CONTRIBUTING.md.

  2. ryoppippi commented on Aug 31, 2026

    @ryoppippi
    Member

    Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.

    Audit result: resolved. A later merged change or the current main implementation covers this request. This item is kept for history and does not need to be reopened.

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

    triage:resolvedResolved by a later change or current implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions