Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taking 3 digit number as year. #22

Open
sandyjais687 opened this issue Feb 6, 2021 · 2 comments
Open

Taking 3 digit number as year. #22

sandyjais687 opened this issue Feb 6, 2021 · 2 comments

Comments

@sandyjais687
Copy link

i tried with this string "R-6/941/KAMDAR ROAD, 01/01/2021" as its taking 941 as 1941 year

@DanielJDufour
Copy link
Owner

DanielJDufour commented Feb 6, 2021

Thank you for posting this issue. Here's the output when I run extract_dates("R-6/941/KAMDAR ROAD, 01/01/2021", debug=True):

match is {'date': '6/941', 'year': '41', 'month': '9', 'day': '6', 'hour': None, 'minute': None, 'second': None, 'system': None, 'tw_year': None, 'mdy': None, 'dmy': '6/941', 'ymd': None, 'my': None, 'y': None}


match is {'date': '01/01/2021', 'year': '2021', 'month': '01', 'day': '01', 'hour': None, 'minute': None, 'second': None, 'system': None, 'tw_year': None, 'mdy': '01/01/2021', 'dmy': None, 'ymd': None, 'my': None, 'y': None}

completes are [{'year': 41, 'month': 9, 'day': 6}, {'year': 2021, 'month': 1, 'day': 1}]

partials are []
starting datetime_from_dict with {'year': 41, 'month': 9, 'day': 6}
starting normalize_year with 41
starting datetime_from_dict with {'year': 2021, 'month': 1, 'day': 1}
starting normalize_year with 2021
extract_dates returning: [datetime.datetime(1941, 9, 6, 0, 0, tzinfo=<UTC>), datetime.datetime(2021, 1, 1, 0, 0, tzinfo=<UTC>)]

Is your expectation that the result be [datetime.datetime(2021, 1, 1, 0, 0, tzinfo=<UTC>)] and 941 is ignored?

@sandyjais687
Copy link
Author

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants