Support

Akeeba Ticket System

#39526 Question: How to change the date/time format

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by nicholas on Wednesday, 27 September 2023 15:13 CDT

[email protected]

Hello,

This is not urgent, but I was trying to change the time/date format for ATS.

For dates we are more familiar with     m-d-Y

For times we use:                                 g:i a

This would result in:                             09-25-2023 1:55 PM

 

I tried creating the following Language Overrides: (See attachment)

DATE_FORMAT_CALENDAR_DATE

DATE_FORMAT_CALENDAR_DATETIME

 

This did not change the date/time format in various ATS ticket views. (see attachment)

I do have custom fields created that are of a calendar type. After making the language overrides, ATS was getting errors when submitting the tickets with the custom calendar fields. Interestingly, the date format of the custom field was formatted using m-d-Y when initially selecting a date.

Any thoughts on if I can change this?

Thanks in advance,

Eric

nicholas
Akeeba Staff
Manager

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!

[email protected]

Nicholas,

Thank you as always for providing detailed background information!

 

Eric

nicholas
Akeeba Staff
Manager

You're welcome! I am glad you ask these questions in public tickets, so I can put this information somewhere were people will find it :)

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!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!