<span class="hoo-today">
    <?php 
if (is_null($this['current_hours'])) {
    ?>
        <span class="na">N/A</span>
    <?php 
} elseif (is_object($this['current_hours'])) {
    ?>
        <span class="open">Open</span>
        <span class="until">Until <?php 
    echo \Hoo\Utils::format_time($this['current_hours']);
    ?>
 </span>
    <?php 
} elseif (is_string($this['current_hours'])) {
    ?>
        <span class="open">Open</span>
        <span class="all-day"><?php 
    echo $this['current_hours'];
    ?>
</span>
    <?php 
} else {
    ?>
        <span class="closed">Closed</span>
    <?php 
}
?>
</span>
                <?php 
    echo $location_data['location']->name;
    ?>
            </a>
        </td>
        <td class="location-status">
            <?php 
    if (is_null($current_hours)) {
        ?>
                <span class="na">N/A</span>
            <?php 
    } elseif (is_object($current_hours)) {
        ?>
                <span class="open">Open</span>
                <span class="until">Until <?php 
        echo \Hoo\Utils::format_time($current_hours);
        ?>
 </span>
            <?php 
    } elseif (is_string($current_hours)) {
        ?>
                <span class="open">Open</span>
                <span class="all-day"><?php 
        echo $current_hours;
        ?>
</span>
            <?php 
    } else {
        ?>
                <span class="closed">Closed</span>
            <?php 
 public function get_fullcalendar_events($params, $entity_manager, $with_title = true)
 {
     // TODO: convert this to how the is_open/get_instances works
     $rrule_transformer = new RRuleTransformer();
     $cal_start = new \Datetime($params['start']);
     $cal_end = new \DateTime($params['end']);
     $event_instances = array();
     $event_dates = array();
     if (isset($params['event']['id']) && empty($params['event']['id'])) {
         $current_event = new Event();
         $this->events->add($current_event);
     }
     foreach ($this->events as $event) {
         if (isset($params['event']['id']) && $params['event']['id'] == $event->id) {
             $event->fromParams($params, $entity_manager);
         } else {
             if ($event->is_recurring) {
                 $event->recurrence_rule = new RRule($event->recurrence_rule, $event->start, $event->end);
             } else {
                 $event->recurrence_rule = new RRule(null, $event->start, $event->end);
             }
         }
         if (!$event->is_visible) {
             continue;
         }
         // get all recurrences
         $cal_range = new BetweenConstraint($cal_start, $cal_end, true);
         $recurrences = $rrule_transformer->transform($event->recurrence_rule, 60, $cal_range)->toArray();
         foreach ($recurrences as $recurrence) {
             $event_instances[] = array('event' => $event, 'recurrence' => $recurrence);
         }
     }
     $event_instances = Utils::remove_overlapping_events($event_instances);
     // TODO: refactor the 24 hours / formatting as it is gross
     $events = array();
     foreach ($event_instances as $instance) {
         $prev_all_day = Utils::prev_was_all_day($instance, $event_instances);
         $next_all_day = Utils::next_is_all_day($instance, $event_instances);
         if ($prev_all_day && $next_all_day) {
             $title = $with_title ? $instance['event']->title . "\n" : '';
             $title .= Utils::format_time($instance['recurrence']->getStart(), $instance['recurrence']->getEnd());
         } elseif ($prev_all_day) {
             $title = sprintf("%s24 Hours -\n%s", $with_title ? $instance['event']->title . "\n" : '', Utils::format_time($instance['recurrence']->getEnd()));
         } elseif ($next_all_day) {
             $title = sprintf("%s%s -\n24 Hours", $with_title ? $instance['event']->title . "\n" : '', Utils::format_time($instance['recurrence']->getStart()));
         } elseif ($instance['event']->is_all_day) {
             $title = sprintf("%sOpen\n24 Hours", $with_title ? $instance['event']->title . "\n" : '');
         } elseif ($instance['event']->is_closed) {
             $title = sprintf("%sClosed", $with_title ? $instance['event']->title . "\n" : '');
         } else {
             $title = $with_title ? $instance['event']->title . "\n" : '';
             $title .= Utils::format_time($instance['recurrence']->getStart(), $instance['recurrence']->getEnd());
         }
         $events[] = array('id' => $instance['event']->id, 'title' => $title, 'start' => $instance['recurrence']->getStart()->format(\DateTime::ISO8601), 'end' => $instance['recurrence']->getEnd()->format(\DateTime::ISO8601), 'color' => $instance['event']->category->color);
     }
     return $events;
 }