You are here

function merci_hours_time_is_open in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Determine if we are open during the given time.

File

merci_hours/merci_hours.module, line 462

Code

function merci_hours_time_is_open($cal, $day, $time) {
  $open_hours = merci_hours_get_open_hours_by_day($cal, $day);
  foreach ($open_hours[$day] as $hours) {
    $open = $hours['open'];
    $close = $hours['close'];
    $open_hour = $open
      ->format('H:i:s');
    $close_hour = $close
      ->format('H:i:s');
    if ($time >= $open_hour and $time <= $close_hour) {
      return TRUE;
    }
  }
  return FALSE;
}