Open pawankg opened 6 years ago
An easy solution is to set a parameter dayfirst=True everywhere parser.parse is called in datefinder.py i.e.: parser.parse(date_string, default=self.base_date, dayfirst=True)
This is a duplicate of #77 and #42
Or you can simply change the init in class class parserinfo(object): in file _parser.py and set datefirst to True
@pawankg Please try installing the master branch version and let me know if the solution works. There is a new first
init option which will let you declare if you want ambiguous dates to be determined by year, month, or day first.
https://github.com/akoumjian/datefinder/blob/master/datefinder/__init__.py#L23
I haven't yet put it in a pypi release.
@pawankg Please try installing the master branch version and let me know if the solution works. There is a new
first
init option which will let you declare if you want ambiguous dates to be determined by year, month, or day first.https://github.com/akoumjian/datefinder/blob/master/datefinder/__init__.py#L23
I haven't yet put it in a pypi release.
Please release this in pypi
While using different dates of format dd/mm/yyyy, I see that it is behaving differently as shown in below example:
Case I:
In this case I, it is extracting year = 2018, month = 4 and day = 19 as expected.
Case II:
But in case II, it is extracting year = 2018, month = 5 and day = 4 (swapped the value of day and month) but it should have been, month = 4 and day = 5.