-
-
Notifications
You must be signed in to change notification settings - Fork 320
Closed
Description
The daily date column can be off by one depending on terminal width. For example, today is the the 6th, but ccusage shows the 5th when the date is shown in its compact two-line format:
├───────────┼───────────────────┼──────────┼──────────┼────────────┤
│ 2025 │ - opus-4 │ 216 │ 10,416 │ $8.46 │
│ 08-05 │ │ │ │ │
├───────────┼───────────────────┼──────────┼──────────┼────────────┤
│ Total │ │ 34,741 │ 580,973 │ $314.38 │
└───────────┴───────────────────┴──────────┴──────────┴────────────┘
When the window width is increased slightly, the date is output on one line with the correct date:
├────────────┼────────────────────┼───────────┼───────────┼─────────────┤
│ 2025-08-06 │ - opus-4 │ 216 │ 10,416 │ $8.46 │
├────────────┼────────────────────┼───────────┼───────────┼─────────────┤
│ Total │ │ 34,741 │ 580,973 │ $314.38 │
└────────────┴────────────────────┴───────────┴───────────┴─────────────┘
loadDailyUsageData does UTC to local YYYY-MM-DD:
2025-08-06T16:00:00.000Z → 2025-08-06 (for me)
formatDateCompact interprets the YYYY-MM-DD as UTC but it is already local time:
2025-08-06 is interpreted as UTC (2025-08-06T00:00:00Z), which is 2025-08-05 20:00:00 in my local time. That gets displayed as 2025-08-05 even though it started out in local time.
Metadata
Metadata
Assignees
Labels
No labels