Example #1
0
 protected function _setStartDay($val)
 {
     $date = new Time($val);
     if (!empty($this->start)) {
         $date->hour($this->start->hour);
         $date->minute($this->start->minute);
         $date->timezone($this->start->timezone);
     }
     if ($date != $this->start) {
         //Do not trigger "dirty" unless actually changed
         $this->start = $date;
     }
     //Need second copy because object pointers...
     $endDate = new Time($val);
     if (!empty($this->end)) {
         $endDate->hour($this->end->hour);
         $endDate->minute($this->end->minute);
         $endDate->timezone($this->end->timezone);
     }
     if ($endDate != $this->end) {
         //Do not trigger "dirty" unless actually changed
         $this->end = $endDate;
     }
 }