You are here

function _office_hours_show_ampm in Office Hours 7

Same name and namespace in other branches
  1. 6 office_hours.module \_office_hours_show_ampm()

Helper function to convert a range of hours from '13' to '13:00 (01:00 pm)'.

This is used in the Widget settings form.

2 calls to _office_hours_show_ampm()
office_hours_field_settings_form in includes/office_hours.field.inc
Implements hook_field_settings_form().
office_hours_handler_filter_hours::value_form in includes/office_hours_handler_filter_hours.inc
Provide a select list for times.

File

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

Code

function _office_hours_show_ampm($hours) {
  foreach ($hours as $key => $hour) {
    if (!empty($hour)) {
      $hours[$key] = _office_hours_time_to_24hr($hour . '00') . ' (' . _office_hours_convert_to_ampm($hour . '00') . ')';
    }
  }
  return $hours;
}