This hack changes the dropdown menus when creating/adding event. Currently, the dropdowns show the 24-hour clock, 0-23. This hack changes those drop down to use the 12-hour clock, making it easier for your users to add events.
Open the piCal.php file and do a search for the method
function get_schedule_edit_htm
. Scroll down through the method and find the following FOR LOOP CODE
$select_start_hour = "<select name='StartHour' $allday_select>\n" ;
for( $h = 0 ; $h < 24 ; $h ++ ) {
. Replace the entire FOR LOOP (between the { }) with the following code:
for( $h = 0 ; $h < 24 ; $h ++ ) {
// Convert 24-hour clock to 12-hour clock
if ($h == 0) {
$x = 12;
$y = "am";
} else if ($h == 12) {
$x = 12;
$y = "pm";
} else if ($h >= 13) {
$x = $h - 12;
$y = "pm";
} else {
$x = $h;
$y = "am";
}
if ($h == $start_hour) {
$select_start_hour .= "<option value='$h' selected='selected'>$x $y</option>\n" ;
} else {
$select_start_hour .= "<option value='$h'>$x $y</option>\n" ;
}
}
Now find the FOR LOOP for the end hour
$select_end_hour = "<select name='EndHour' $allday_select>\n" ;
for( $h = 0 ; $h < 24 ; $h ++ ) {
and replace the entire FOR LOOP with the following code
for( $h = 0 ; $h < 24 ; $h ++ ) {
// Convert 24-hour clock to 12-hour clock
if ($h == 0) {
$x = 12;
$y = "am";
} else if ($h == 12) {
$x = 12;
$y = "pm";
} else if ($h >= 13) {
$x = $h - 12;
$y = "pm";
} else {
$x = $h;
$y = "am";
}
if ($h == $end_hour) {
$select_end_hour .= "<option value='$h' selected='selected'>$x $y</option>\n" ;
} else {
$select_end_hour .= "<option value='$h'>$x $y</option>\n" ;
}
}