scrapinghub / scrapinghub/dateparser

Time part should not be there if time in search_dates output if time information is not present in text.

Open
#1,162 1 comment 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

I have used search_dates in dateparser.search. The output of search_dates is 00:00:00 when time information is not present.
For example in I will connect with you on Monday, the output is [('on monday', datetime.datetime(2023, 4, 10, 0, 0))].

Is it possible for these cases where time is not present, we return only the date part of the datetime and not return time as 0,0? In postprocessing to remove time when it is 0,0. But, it will create problems when the time is indeed 0,0.
How to solve this?

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

Start with the search_dates entry point in dateparser.search and reproduce the Monday example from the issue. Trace how absent time is represented and how explicit midnight is distinguished before deciding on the return contract. Done means the example omits time without changing cases where midnight was explicitly present, with regression coverage for both.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.