-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Relative date filtering #12901
Copy link
Copy link
Open
Labels
docsenhancementa request to improve CLIa request to improve CLIgh-issuerelating to the gh issue commandrelating to the gh issue commandgh-prrelating to the gh pr commandrelating to the gh pr commandgh-searchrelating to the gh search commandrelating to the gh search commandstale
Metadata
Metadata
Assignees
Labels
docsenhancementa request to improve CLIa request to improve CLIgh-issuerelating to the gh issue commandrelating to the gh issue commandgh-prrelating to the gh pr commandrelating to the gh pr commandgh-searchrelating to the gh search commandrelating to the gh search commandstale
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the feature or problem you’d like to solve
When filtering by date it would be helpful to allow relative dates such as
-7dfor the last 7 days.Although the docs are not at all clear, it seems you can do ranges but only with absolute dates:
Proposed solution
It would be great to add support for negative offsets from today e.g.
--updated ">=-1d"to find all PRs updated in the last 24h (or today + yesterday inclusive if the date filtering is only done by full day boundaries, I don't mind).This will be useful for those wishing to automatically show only recently-updated PRs.
Additional context
It would also be helpful if the gh cli docs were more helpful about what date filters are supported.
For example
gh search prs --help(and the online equivalent) lists all the following options:but does not explain how to use them, either inline or with an example.
From guesswork (based on web github) and just trying stuff it seems that you can do the following:
so it would be nice to have this documented, including any other options (if there are any).