scrapinghub / scrapinghub/dateparser

Incomplete time - missing minutes are effecively making the hour ignored

Open
#1,080 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

Hello!

I don't know if I'm missing something, or not. Is there a way to parse tomorrow at 12 and have the lib assume the minutes value? (i.e. have the same result as tomorrow at 12:00?)

Currently it looks like it completely ignores the hour:

>>> dateparser.parse("tomorrow")
datetime.datetime(2022, 9, 21, 1, 35, 9, 50714)

>>> dateparser.parse("tomorrow at 12")
datetime.datetime(2022, 9, 21, 1, 35, 11, 6990)

>>> dateparser.parse("tomorrow at 12:00")
datetime.datetime(2022, 9, 21, 12, 0)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the three examples from the issue, especially the difference between “tomorrow at 12” and “tomorrow at 12:00”. Trace the parsing path for an hour without minutes, then verify that the incomplete form preserves hour 12 and assumes minutes of 00 while the existing examples remain correct.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.