You are here

function _office_hours_time_to_24hr in Office Hours 7

3 calls to _office_hours_time_to_24hr()
_office_hours_block_validate in includes/office_hours.elements.inc
Implements a callback for _office_hours_elements().
_office_hours_show_ampm in ./office_hours.module
Helper function to convert a range of hours from '13' to '13:00 (01:00 pm)'.
_office_hours_time_format in ./office_hours.module
Helper function to convert a time to a given format.

File

./office_hours.module, line 182
Creates a field and widget for inserting working or office hours per day

Code

function _office_hours_time_to_24hr($time = '') {
  if (strstr($time, ':')) {
    return $time;
  }
  else {
    $time = substr('0000' . $time, -4);
    $hour = substr($time, 0, -2);
    $min = substr($time, -2);
    return $hour . ':' . $min;
  }
}