You are here

function theme_office_hours_time_range in Office Hours 7

Theme function for formatter: time ranges.

1 theme call to theme_office_hours_time_range()
theme_office_hours_field_formatter_default in includes/office_hours.theme.inc
Theme function for field formatter.

File

includes/office_hours.theme.inc, line 153
Themes the Office hours formatter and widget.

Code

function theme_office_hours_time_range($vars = array()) {

  // Add default values to $vars if not set already.
  $vars += array(
    'times' => array(
      'start' => '',
      'end' => '',
    ),
    'format' => 'G:i',
    'separator' => ' - ',
  );
  $starttime = _office_hours_time_format($vars['times']['start'], $vars['format']);
  $endtime = _office_hours_time_format($vars['times']['end'], $vars['format']);
  $comment = $vars['times']['comment'];
  if ($endtime == '0:00' || $endtime == '00:00') {
    $endtime = '24:00';
  }
  $result = $starttime . $vars['separator'] . $endtime . ' ' . $comment;
  return $result;
}