scrapinghub / scrapinghub/dateparser
rounding up and down
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Hi, I am working on a program where the user can select some files using newer-than and older-than predicates as for instance:
foo --older-than=yesterday --newer-than="5 days ago"
The issue I have is that dataparser uses the current time when that part is missing. So, for instance, that --older-than=yesterday above, becomes something like 2021-05-02 14:42:36.990992, but what I need is 2021-05-02 00:00:00.
On the other hand, I would like --newer-than=yesterday to become 2021-05-02 23:59:59.99999. And in a similar fashion, I would like --newer-than=2020 to become 2020-12-31 23:59:59.99999.
The idea is very similar to that of PREFER_DAY_OF_MONTH but for all the parts, not just months.
Contributor 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.
Research direction
Start by reproducing the --older-than and --newer-than examples from the issue and trace how dateparser fills missing components. Confirm the intended boundaries for days and years, then add coverage showing that each predicate resolves to the requested start or end of the period.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100