changing time condition time from 12 to 24

Mikeme

Member
Apr 26, 2021
79
2
8
37
Hi,
I looked everywhere and cant find how to change time from(12hours) AM/PM to 24 hours.
Anyone?
 
Jan 9, 2018
120
12
18
52
I'm assuming you mean the "Time of Day" condition. I don't see any options to change the way it displays. But note that, when it stores the info in the dialplan, it is stored as "minute-of-day" with the minute number as the data.

However, the "Date & Time" condition does seem to display as 24-hr time and may be an option for you.
 

Mikeme

Member
Apr 26, 2021
79
2
8
37
Thank you Jonathan, Date & Time is not relevant since its provide date and i'm talking about "Time of Day".
attached time condition settings.
anyone can help with that?
 

Attachments

  • time of day.png
    time of day.png
    6.6 KB · Views: 3
Jan 9, 2018
120
12
18
52
Well, I looked at the code for the time conditions page and the bad news is that it's hard-coded this way. The good news is that it shouldn't be all THAT difficult for you to change, if you want to give it a try. It's in app/time_conditions/ and the file is time_condition_edit.php. Make a backup copy first, but then you can search for:
case 'time-of-day'
In the block below that, you'll need to change the two lines starting with sel_start.options and sel_stop.options.

You can change these to:
sel_start.options[sel_start.options.length] = new Option(pad(h, 2) + ':' + pad(m, 2)); sel_stop.options[sel_stop.options.length] = new Option(pad(h, 2) + ':' + pad(m, 2));

That should accomplish what you want.
 

Mikeme

Member
Apr 26, 2021
79
2
8
37
Thanks.
I try this and it does shows 24 hours but once click save parameters disappear.
Any idea?
 
Jan 9, 2018
120
12
18
52
Not sure. Sorry. It is actually saving the selection. Not sure why the display isn't working. You'll probably need to do some troubleshooting.