feat: Add strftime format support to --after flag for consistent time parsing #251
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
The
--afterflag was missing strftime format parsing support that already existed in the--beforeflag. When users set a custom time format using--time-stylewith+FORMAT(likedate(1)), the--beforeflag could parse dates in that format, but--aftercould not, leading to inconsistent behavior.Solution
Added the missing strftime parsing logic to the
--afterflag by mirroring the existing implementation from the--beforeflag. Both flags now consistently support:MM-dd,MM-dd HH:mm,HH:mm,YYYY-MM-dd,YYYY-MM-dd HH:mm--time-styleis set with+FORMATExample Usage
Changes Made
--afterflag ininternal/cli/filtering.go+and usesstrftime.Parse()accordinglyTesting
%Y-%m-%d,%m/%d/%Y,%Y-%m-%d %H:%M)Fixes #245.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.