function _office_hours_mil_to_tf in Office Hours 6.2
Same name and namespace in other branches
- 6 office_hours.module \_office_hours_mil_to_tf()
3 calls to _office_hours_mil_to_tf()
- office_hours_select_process in ./
office_hours.elements.inc - Process the hours selector element.
- theme_office_hours_formatter_default in ./
office_hours.theme.inc - Theme function for 'default' text field formatter.
- _office_hours_convert_to_ampm in ./
office_hours.module - Helper function for conversion of clock format.
File
- ./
office_hours.module, line 341 - Creates a field and widget for inserting working or office hours per day
Code
function _office_hours_mil_to_tf($time = '') {
$hour = substr($time, 0, -2) ? substr($time, 0, -2) : '0';
$min = substr($time, -2) ? substr($time, -2) : '00';
return $hour . ":" . $min;
}