`formless usage` buckets by UTC day with no label or local-time option, so usage for non-UTC users lands on the wrong date
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with Store::usage_grouped and the UsageByDay input, then inspect the formless usage CLI path that builds the request and the existing usage grouping tests. Check how UTC timestamps and --since are handled before deciding which suggested behavior to implement. Done means the chosen day and cutoff behavior is explicit to CLI users and covered by a test, including the supplied UTC+7 example.
Written by the indexing model from the issue text.
Description
Problem
formless usage defaults to --by day, and Store::usage_grouped builds the day key as substr(u.created_at, 1, 10), using the stored UTC RFC 3339 timestamp. Every daily bucket is therefore a UTC day, but the human table just labels the column KEY with values like 2026-11-17 and never mentions UTC (only SPEC/the code comment do).
For anyone not on UTC this puts usage on the wrong day. For example, at UTC+7, everything from midnight to 07:00 local time is counted on the previous date. At UTC-5, evening work lands on the next date. "How much did I spend today?" gets the wrong answer, and the most recent row can look nearly empty for most of the local morning.
--since adds a related problem: the cutoff is now - DURATION, an exact instant, so with --since 7d the oldest day row covers only part of that day but looks like any other day.
Suggested fix
- Bucket by the caller's local day. The CLI knows its UTC offset (
chrono::Local), so it could send an optionalutc_offset_minuteswithUsageByDay, andusage_groupedwould group bydate(u.created_at, '+N minutes'). When the field is omitted, keep today's UTC behaviour for the TUI/web and old clients. (A fixed offset is wrong across a DST change; that's acceptable for a summary view, or the CLI could re-bucket per row.) - At minimum, title the day column
DAY (UTC)in the human table so the current behaviour is visible. - For
--by day --since D, either round the cutoff down to the start of that (local) day or mark the first row as partial. - Add a test with a row at 2026-11-16T20:00:00Z and offset +420 that expects key
2026-11-17.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 12h 10m
- Merged PRs (30d)
- 780
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from athiwatc/formless
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
All issues in athiwatc/formless
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
symposium-dev/symposium#530 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day
-
Invalid JSON options for ngram and edge_ngram silently use defaultsPossibly taken @Tilendlesa claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
noemaforge/vimanam#153 ·
Maintainers usually reply within 1 day