date-extractor icon indicating copy to clipboard operation
date-extractor copied to clipboard

day and month coming out swapped

Open pavasgdb opened this issue 4 years ago • 2 comments

For the string "5/1/2016 ", the results are "date": "2016-05-01", the day and month are shown opposite. Kindly tell if some parameter can be used to manually handle this. Or kindly provide a fix for it.

pavasgdb avatar Jun 27 '20 23:06 pavasgdb

Hello, excellent find. Thank you for bringing this to our attention. Unfortunately, there's no easy fix for this, but it's something that could be written. Would you be interested in writing a Pull Request? What sort of parameter would you like to see?

Perhaps:

text = "5/1/2016"
date = extract_date(text, country="India")
# returns "2016-01-05"

date = extract_date(text, country="USA")
# returns "2016-05-01"

Open to your thoughts

DanielJDufour avatar Jun 27 '20 23:06 DanielJDufour

Yeah, this seems to be a good parameter. I would be interested in writing a pull request. Just I am a little busy with my internship, your assistance for the same would be very helpful.

pavasgdb avatar Jun 27 '20 23:06 pavasgdb