scrapinghub / scrapinghub/dateparser

Incorrect hungary date parsing

Open
#1,015 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

python -c 'import dateparser as D;p=D.DateDataParser(languages=["hu"]);print(p.get_date_data("október 29., péntek 9:13"))'              
{'date_obj': datetime.datetime(2029, 10, 1, 9, 13), 'period': 'day', 'locale': 'hu'}                    

vs

python -c 'import dateparser as D;p=D.DateDataParser(languages=["en"]);print(p.get_date_data("october 29., friday 9:13"))'              
{'date_obj': datetime.datetime(2021, 10, 29, 9, 13), 'period': 'day', 'locale': 'en'}   

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

Run the provided Hungarian and English DateDataParser commands to reproduce the differing results, then trace the Hungarian locale's handling of month, weekday, and day values. The fix is done when "október 29., péntek 9:13" resolves to October 29 at 9:13 rather than October 1, with a regression test for the Hungarian input.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.