scrapinghub / scrapinghub/dateparser
Unable to parse "the 1st day of March"
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Adding "day" in the middle of a date fails parsing:
>>> import dateparser as dp
>>> dp.parse("the 1st day of March, 2025")
>>> dp.parse("the 1st of March, 2025")
datetime.datetime(2025, 3, 1, 0, 0)
Version 1.2.1
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 two dateparser calls from the issue and trace how date expressions containing "day" are handled. Locate the relevant parsing logic and add a regression test for "the 1st day of March, 2025"; done means it returns the same date as the equivalent expression without "day".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100