fix: anchor git date filters to local midnight#2
Merged
Conversation
git's --since/--until parse a bare YYYY-MM-DD via approxidate, filling the missing time-of-day with the current wall-clock time. This skewed every reporting window by the time of day it was run -- e.g. the "Yesterday" preset swept in same-morning commits while "Today" missed them. Anchor bare ISO dates to 00:00:00 before passing them to git; relative strings like "7 days ago" pass through untouched.
This was referenced May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Selecting Yesterday in the range picker showed commits dated today, and Today reported "nothing found" for commits that clearly existed.
Root cause:
internal/collect/git.gopassed bareYYYY-MM-DDdates togit log --since/--until. Git parses bare dates with approxidate, which fills the missing time-of-day with the current wall-clock time. So every reporting window was shifted by however late in the day you ran the tool:[May 24 14:54 → May 25 14:54)→ wrongly swept in same-morning commits[May 25 14:54 → May 26 14:54)→ wrongly excluded those same commitsFix
Added an
anchorMidnighthelper that pins bare ISO dates to00:00:00before handing them to git. Relative strings like"7 days ago"(from--since) pass through untouched.Verification
Rebuilt and re-ran the TUI:
2026-05-24, only May 24 commits ✅2026-05-25, the 8 May 25 commits now appear (previously "nothing found") ✅