简体   繁体   English

我将如何搜索过去 x 天内创建的 Github 问题?

[英]How would I search Github issues created in the last x days?

Also asked here but in 2016 and with no working answer.也在这里问过,但在 2016 年,没有有效的答案。

I'd like to search for issues created x number of days ago, but can only find how to search using actual (hardcoded, if you will) dates.我想搜索 x 天前创建的问题,但只能找到如何使用实际(硬编码,如果你愿意的话)日期进行搜索。 For example, I want to search for issues created less than 7 days ago.例如,我想搜索不到 7 天前创建的问题。

I've read through their search syntax documentation and cannot figure out a way to do that.我已经阅读了他们的搜索语法文档,但无法找到一种方法来做到这一点。

Currently, as mentioned in their Search Syntax docs :目前,如他们的搜索语法文档中所述:

You can search for dates that are earlier or later than another date, or that fall within a range of dates, by using >, >=, <, <=, and range queries.通过使用 >、>=、<、<= 和范围查询,您可以搜索早于或晚于另一个日期的日期,或者在某个日期范围内的日期。 Date formatting must follow the ISO8601 standard, which is YYYY-MM-DD (year-month-day).日期格式必须遵循 ISO8601 标准,即 YYYY-MM-DD(年-月-日)。

Meaning, unfortunately, they do not provide an out-of-the-box approach for you to do this relative searching.这意味着,不幸的是,它们没有为您提供一种开箱即用的方法来进行这种相对搜索。

If you're using the UI search, you can use the sort to be by Newest , while if you're using the API/GraphQL, you will need to write a function to take in the x number of days, generate a compliant ISO8601 date and pass to your request.如果您使用 UI 搜索,您可以使用按Newest排序,而如果您使用 API/GraphQL,则需要编写一个函数来获取x天数,生成符合ISO8601的日期并传递给您的请求。

Not the answer you were hoping for, but I hope this helps clarify it.不是您希望的答案,但我希望这有助于澄清它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM