Calendar fields (built-in and custom fields) are handled by Joomla! itself.
Unfortunately, because of the way the calendar field is coded what you see is what is sent to the server. Therefore, the date format must be YYYY-MM-DD HH:mm
for the date and time to be read correctly by the server. I know it's subpar. I didn't write that code, another Greek did, and he is not in the habit of releasing mass-distributed software or supporting the same software for decades like I do. But I digress.
A better way to handle it is using the HTML5 INPUT
element with type="datetime-local"
. The display of the date and time follows the Operating System's locale (therefore in the US it would be exactly what you want) and the submitted value is always in the form YYYY-MM-DDTHH:mm
.
There are two problems with that.
The first problem is that this is not supported by all browsers yet. The biggest problems here are Safari and Firefox which only added support about 3–4 years ago. It will take another year or two before we can safely ditch support for these old versions. I tried that prematurely two years ago and the results were… not very great. We had users left looking at a plain text box where they'd mess up the date (there seem to be more local date formats than there are stars in the sky…).
The second problem is that Joomla —and Bootstrap itself— provides no styling for this kind of input, making it look “out of place”.
I can live with the latter but not the former. Therefore, I am biding my time, waiting for October 2024 when I will ditch support for Joomla 4 and older browsers.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!