sisyphsu / dateparser

dateparser is a smart and high-performance date parser library, it supports hundreds of different formats, nearly all format that we may used. And this is also a showcase for "retree" algorithm.
MIT License
95 stars 23 forks source link

Date Parsing Rpoblem #26

Open hAzUpL8 opened 2 years ago

hAzUpL8 commented 2 years ago

Hi, In Slovenia date format is "d. M. yyyy" (Example: "13. 4. 2022") and the problem is that this dateParser can't parse it:

Exception in thread "main" java.time.format.DateTimeParseException: Text 12. 4. 2022 cannot parse at 0 at com.github.sisyphsu.dateparser.DateParser.error(DateParser.java:401) at com.github.sisyphsu.dateparser.DateParser.error(DateParser.java:397) at com.github.sisyphsu.dateparser.DateParser.parse(DateParser.java:131) at com.github.sisyphsu.dateparser.DateParser.parseDate(DateParser.java:67) at com.github.sisyphsu.dateparser.DateParserUtils.parseDate(DateParserUtils.java:29) at si.zzi.eforms.wp.utils.DateJSFConverter.main(DateJSFConverter.java:51)

Can you help? regards

andriy-samson commented 2 years ago

It looks like Slovenia data format is d.M.yyyy but in your example you use similar format but with extra space "d. M. yyyy". Are you sure that this is official format with spaces? For me it looks like a custom format, so you have to use a custom parser for this (example: SimpleDateFormat) Without spaces it is parsed without error.

hAzUpL8 commented 2 years ago

Ok, I can do this with a custom parser, but unfortunately the official Slovenian date format is with extra spaces! [image: image.png] regards Haris

V V pon., 4. apr. 2022 ob 21:57 je oseba andriy-samson < @.***> napisala:

It looks like Slovenia data format is d.M.yyyy but in your example you use similar format but with extra space "d. M. yyyy". Are you sure that this is official format with spaces? For me it looks like a custom format, so you have to use a custom parser for this (example: SimpleDateFormat) Without spaces it is parsed without error.

— Reply to this email directly, view it on GitHub https://github.com/sisyphsu/dateparser/issues/26#issuecomment-1087954242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AICMDYRGQBVEMPWKVLQYIADVDNCTJANCNFSM5SOVIJUA . You are receiving this because you authored the thread.Message ID: @.***>

--

Lp. HarisŽujo