scrapinghub / scrapinghub/dateparser
odd behaviour with plus sign
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Specifics: dateparser v1.0.0 && Python 3
Using now + <x> mins results in time subtraction rather than adding, which is odd and fails intuition
In [17]: dateparser.parse('now', languages=['en']).ctime()
Out[17]: 'Sat May 15 13:07:06 2021'
In [18]: dateparser.parse('now + 10 mins', languages=['en']).ctime()
Out[18]: 'Sat May 15 12:57:13 2021'
However, using the word in after the + sign seems to get the right result, but that also makes the now + unnecessary.
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
Reproduce the examples with dateparser v1.0.0 and Python 3, comparing now + 10 mins with the form using in. Trace how relative expressions containing a plus sign are interpreted. Done means the plus form adds the requested duration and a regression test covers this behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100