scrapinghub / scrapinghub/dateparser

German date with leading zeros not working properly when no year given

Open
#902 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Reproduction

I'm using this method to parse a german date without year:

dateparser.parse('13.01.', languages=['de'])

What I get returned is a datetime object with the current date and time, no reference to my given date-string. If I leave out the zero, it's working. If I add a year, it's working. So the following is no problem and parsed properly:

dateparser.parse('13.1.', languages=['de'])
dateparser.parse('13.01.2001', languages=['de'])

Using the format MM/DD is also no problem and working fine for me, but DD.MM is not.

System

  • OS: Arch Linux 5.11.11-arch1-1 and Arch Linux 5.11.4-1-ARCH
  • Version: v1.0.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 German examples with dateparser.parse, comparing 13.01. against 13.1. and 13.01.2001. Trace the parser path used for German DD.MM input and add or update coverage so a yearless date with a leading zero returns the supplied date rather than the current datetime.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.