protected function valueForType($type, $value) { $valueForType = $value; switch ($type) { case 'datetime': $valueForType = DateFormatter::formatDateRange($value, DateFormatter::LONG_STYLE, DateFormatter::NO_STYLE); if ($value instanceof TimeRange) { $timeString = DateFormatter::formatDateRange($value, DateFormatter::NO_STYLE, DateFormatter::MEDIUM_STYLE); $valueForType .= "<br />\n" . $timeString; } break; case 'url': $valueForType = str_replace("http://*****:*****@', '@­', $value); break; case 'category': $valueForType = $this->ucname($value); break; } return $valueForType; }
public static function timeText($event, $timeOnly = false) { if ($timeOnly) { if ($event->getEnd() - $event->getStart() == -1) { return DateFormatter::formatDate($event->getStart(), DateFormatter::NO_STYLE, DateFormatter::SHORT_STYLE); } else { return DateFormatter::formatDateRange($event->getRange(), DateFormatter::NO_STYLE, DateFormatter::SHORT_STYLE); } } else { return DateFormatter::formatDateRange($event->getRange(), DateFormatter::SHORT_STYLE, DateFormatter::SHORT_STYLE); } }
protected function timeText(AthleticEvent $event, $timeOnly = false) { return DateFormatter::formatDateRange($event->getRange(), DateFormatter::SHORT_STYLE, DateFormatter::SHORT_STYLE); }
public function __toString() { return DateFormatter::formatDateRange($this, DateFormatter::MEDIUM_STYLE, DateFormatter::NO_STYLE); }
public function getScheduleLinks($timeRange, $data = null) { $events = $this->getEvents($timeRange); $scheduleLinks = array(); foreach ($events as $event) { $subtitle = DateFormatter::formatDateRange($event, DateFormatter::NO_STYLE, DateFormatter::SHORT_STYLE); $options = array('id' => $this->getID(), 'time' => $event->get_start()); if (isset($data['section'])) { $options['section'] = $data['section']; } if (isset($data['groupID'])) { $options['groupID'] = $data['groupID']; } $class = ''; if ($data['showDetail']) { $url = $this->buildBreadcrumbURL('schedule', $options, true); } else { $url = false; } if ($event->contains(new TimeRange(time()))) { $class = 'open'; } else { $class = 'closed'; } $scheduleLinks[] = array('title' => $class, 'subtitle' => $subtitle, 'url' => $url, 'listclass' => $class); } return $scheduleLinks; }