scrapinghub / scrapinghub/dateparser
Strings with year abbreviation don't parse correctly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
Hi there
I just started evaluating this library for use in a service. I noticed a small bit of trivia that I've found with other datetime parsing libraries.
Passing in 1y does not parse correctly. I can understand, since there is no 1m to mean one month, but year should be a unique character, at least to the english language?
As of 04/09/19, it outputs 2019-04-01 00:00:00. I'm not 100% on what unit it's deciding on, but maybe someone else will have some insight.
What makes this more interesting is if I pass en in a list of languages, it just returns None. As a matter of fact, en doesn't work at all.... Hm. I'll figure out what I'm doing wrong there
Thanks!
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
Start by reproducing the reported 1y input and the language-list case using en, then trace the parser entry point that handles abbreviated units and language selection. Done means the intended year abbreviation behavior is defined and covered for both examples, with the existing parsing behavior verified by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100