コード例 #1
0
ファイル: CalendarDateTime.php プロジェクト: vinstah/body
 public function DateRange()
 {
     list($strStartDate, $strEndDate) = CalendarUtil::get_date_string($this->StartDate, $this->EndDate);
     $html = "<span class='dtstart' title='" . $this->MicroformatStart() . "'>" . $strStartDate . "</span>";
     $html .= $strEndDate != "" ? "-" : "";
     $html .= "<span class='dtend' title='" . $this->MicroformatEnd() . "'>";
     $html .= $strEndDate != "" ? $strEndDate : "";
     $html .= "</span>";
     return $html;
 }
コード例 #2
0
 public function DateHeader()
 {
     switch ($this->view) {
         case "day":
             return CalendarUtil::localize($this->startDate->get(), null, CalendarUtil::ONE_DAY_HEADER);
             break;
         case "month":
             return CalendarUtil::localize($this->startDate->get(), null, CalendarUtil::MONTH_HEADER);
             break;
         case "year":
             return CalendarUtil::localize($this->startDate->get(), null, CalendarUtil::YEAR_HEADER);
             break;
         case "range":
         case "week":
         case "weekend":
             list($strStartDate, $strEndDate) = CalendarUtil::get_date_string($this->startDate->date(), $this->endDate->date());
             return $strStartDate . $strEndDate;
             break;
         default:
             return $this->DefaultDateHeader;
             break;
     }
 }
 /**
  * @return string
  */
 public function getTitle()
 {
     $parts = CalendarUtil::get_date_string($this->StartDate, $this->EndDate);
     if ($parts) {
         $date = implode(' ', $parts);
     } else {
         $date = 'No date';
     }
     if ($this->AllDay) {
         return sprintf(_t('EventManagement.DATEALLDAY', '%s (all day)'), $date);
     }
     if (!$this->StartTime) {
         return $date;
     }
     $time = $this->obj('StartTime')->Nice();
     if ($this->EndTime) {
         $time .= ' - ' . $this->obj('EndTime')->Nice();
     }
     return "{$date} {$time}";
 }