Calendar Field - Days and Months are switching after input

calendar field incorrectly swaps day and month values during keyboard entry.

Overview

The issue occurs when manually typing dates where the day is 12 or less, causing the system to misinterpret the day and month.
Use a standard text field with the built-in date mask feature instead of the calendar field to ensure correct date formatting.

Answered
ChronoForms v6
in ingenium 24 Oct, 2023
Hello,

I just stumbled across an issue with the calendar field. Unfortunately it will switch the value for day and month if you an input by keyboard where DD <= 12.

Display Format AND Real Format is set to DD.MM.YYYY. If you write your date with the keyboard for example 02.10.2023 (DD.MM.YYYY) it will change it to 10.02.2023 (DD.MM.YYYY) in the field, when you click outside of the field. If you write a date where the day is over 12 f.e. 22.10.2023 it won't change it. If you use the datepicker it works correctly.

Thanks for your help and best regards.
Max_admin Max_admin 24 Oct, 2023
Answer
yes, you need to set the field to "readonly" using the HTML attributes setting, that should prevent keyboard input
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
in ingenium 25 Oct, 2023
Hello Max,

thanks for your reply.

I don't want to prevent keyboard input, because I think most users are faster and it's easier to use the keyboard. Is there a way to ensure, that Days and Months are saved correctly?

Best regards
Max_admin Max_admin 25 Oct, 2023
you may use a normal text field with a "Field mask" then
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
in ingenium 25 Oct, 2023
1 Likes
Thanks Max,

I didn't knew there was already this "date masks" implemented for text fields. I think I'm going with that option.

Have a nice day, best regards
This topic is locked and no more replies can be posted.