tkcalendar icon indicating copy to clipboard operation
tkcalendar copied to clipboard

Date validation in Dateentry

Open Tech-GS opened this issue 4 years ago • 1 comments

The date validation manually entered in Dateentry works a little strange. Any characters entered on the left or right of the day, month, year, the program considers valid. For example, if you set the date 12.03.2010 in the calendar, and then enter fg15jkl.iu08.2019jhe in the Entry field, the calendar opens on the date 15.08.2019. Validation only works if the characters are entered inside the day, month, year, for example, 1gh6.08.2019. Calendar v1.5, OS Windows, 'locale': 'ru_RU' validation

Tech-GS avatar Aug 17 '19 16:08 Tech-GS

I had not noticed this behavior, which comes from babel module: their parse_date function seems to ignore the extra characters you inserted. You can ask babel developers the reason for this behavior.

I don't intend to code my own date parsing function and as I already use babel to get the days and months names in the chosen locale, I'd rather not add another dependency by using a different module to parse the dates.

j4321 avatar Aug 26 '19 07:08 j4321