$day = date('D, M d Y', $ts);
$time = date('g:ia', $ts);
//print_r($ent);
- if (($day !== $last_day) && empty($_REQUEST['json'])) {
- $this->events[] = (object) array(
- 'isday' => 1,
- 'day' => $day
- );
+
+ $add = $h->toArray();
+
+ if ($day !== $last_day) {
+ $add['first_of_day'] = 1;
}
- $h->time = $time;
-
- $last_day = $day;
- $M = array();
-
-
- $h->object = $h->objectCached();
+
+ $h['object'] = $h->objectCached();
- $this->events[] = empty($_REQUEST['json']) ? $h : $h->toArray();
+ $this->events[] = $add;