public function url()
 {
     if (empty($this->startDate) || empty($this->endDate)) {
         throw new KurogoConfigurationException('Start or end date cannot be blank');
     }
     $diff = $this->endTimestamp() - $this->startTimestamp();
     if ($diff < 86400 || $diff == 89999) {
         // fix for DST
         if (count($this->trumbaFilters) > 0) {
             $this->setRequiresDateFilter(false);
             $this->addFilter('startdate', $this->startDate->format('Ymd'));
             $this->addFilter('days', 1);
         } else {
             $this->setRequiresDateFilter(true);
             $this->addFilter('startdate', $this->startDate->format('Ym') . '01');
             $this->addFilter('months', 1);
         }
     } elseif ($diff % 86400 == 0) {
         $this->setRequiresDateFilter(false);
         $this->addFilter('startdate', $this->startDate->format('Ymd'));
         $this->addFilter('days', $diff / 86400);
     } else {
         Kurogo::log(LOG_WARNING, "Non day integral duration specified {$diff}", 'calendar');
     }
     return parent::url();
 }
    public function url()
    {
        if (empty($this->startDate) || empty($this->endDate)) {
            throw new Exception('Start or end date cannot be blank');
        }
        
        $diff = $this->endTimestamp() - $this->startTimestamp();

        if ($diff<86400 || $diff == 89999) { // fix for DST
            if (count($this->trumbaFilters)>0) {
                $this->setRequiresDateFilter(false);
                $this->addFilter('startdate', $this->startDate->format('Ymd'));
                $this->addFilter('days', 1);
            } else {
                $this->setRequiresDateFilter(true);
                $this->addFilter('startdate', $this->startDate->format('Ym').'01');
                $this->addFilter('months', 1);
           }
        } elseif ($diff % 86400 == 0) {
            $this->setRequiresDateFilter(false);
            $this->addFilter('startdate', $this->startDate->format('Ymd'));
            $this->addFilter('days', $diff / 86400);
        } else {
            trigger_error("Non day integral duration specified $diff", E_USER_ERROR);
        }
        
        return parent::url();
    }
 protected function url()
 {
     $this->addFilter('orderby', 'starttime');
     $this->addFilter('sortorder', 'a');
     $this->addFilter('singleevents', 'true');
     if ($this->startDate) {
         $this->addFilter('start-min', $this->startDate->format('c'));
     }
     if ($this->endDate) {
         $this->addFilter('start-max', $this->endDate->format('c'));
     }
     return parent::url();
 }