scrapinghub / scrapinghub/dateparser
Feature Request - MDY or DMY based on locale?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 520
- Avg merge
- 22h 56m
- Merged PRs (30d)
- 6
Description
I know there is language-based default for MDY/DMY, but is it possible to add support to locales? For example, en-gb should have DMY, but language "en" is MDY. I tried passing in the region as suggested in the docs but it didn't work as expected:
dateparser.parse("1/12", languages=["en"], region="gb")
datetime.datetime(2019, 1, 12, 0, 0)
dateparser.parse("1/12", languages=["en"], region="us")
datetime.datetime(2019, 1, 12, 0, 0)
I'm unsure if this is a bug or asking for a new feature.
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 two dateparser.parse examples with languages=["en"] and regions "gb" and "us". Trace how the region argument affects locale-based date ordering; done means en-gb parses "1/12" as DMY while en-us retains MDY, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- internationalization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100