Display 12 hour time format for all calendar views

In the scheduler.php code for the Upcoming sidebar (see below), each event date/time is formatted using date_i18n using get_option(‘date_format’) and get_option(‘time_format’). This converts the 24 hour date/time format into a readable 12 hour format with an am/pm indicator. What files would need to be modified to include this same conversion for all calendar views? Is this thread viewtopic.php?f=16&t=13679&p=40216&hilit=starting+and+end+time#p40216 on this same track?

[code]// Start list of events scheduled for Upcoming
for ($i = 0; $i < count($events); $i++) {
// Set the variable event = template (sidebar.php)
$event = $sidebarEvent;
// Replace all string placeholders
$start_date = str_replace("-", “/”, $events[$i][‘start_date’]);
$start_date = date_parse($events[$i][‘start_date’]);
$start_date = mktime($start_date[‘hour’], $start_date[‘minute’], $start_date[‘second’], $start_date[‘month’], $start_date[‘day’], $start_date[‘year’]);
$start_date = date_i18n(get_option(‘date_format’).’ '.get_option(‘time_format’), $start_date);

	$event = str_replace("{*URL*}", $url, $event);
	$event = str_replace("{*DATE*}", $start_date, $event);
	$event = str_replace("{*DATE_SQL*}", $events[$i]['start_date'], $event);
	$event = str_replace("{*TEXT*}", stripslashes($events[$i]['text']), $event);
	$final .= $event;
}
$final .= '</ul>';
return $final;

// END $final[/code]

Can be done without modification

Admin -> Scheduler -> Templates
Set “Hour date” as

%h:%i %A

Thanks, that was a simple modification!

Outstandingly simple solution. I have to wonder why the default is not 12hr/AM-PM, and why there isn’t a more ovbious setting for this. :nerd:

Hi,
time templates are based on scheduler configuration.
It’s quite effective way to specify templates.
If you like to configure any other time templates you may add them into scheduler_include.html file.
Here is documentation about configuring scheduler templates:
docs.dhtmlx.com/doku.php?id=dhtm … #templates