Example #1
0
 protected function beforeValidate()
 {
     //convert to storage format
     $this->end_date_timestamp = CDateTimeParser::parse($this->end_date, 'dd/MM/yyyy HH:mm');
     $this->end_date = Yii::app()->dateFormatter->format('yyyy-MM-dd HH:mm:ss', $this->end_date_timestamp);
     $this->start_date_timestamp = CDateTimeParser::parse($this->start_date, 'dd/MM/yyyy HH:mm');
     $this->start_date = Yii::app()->dateFormatter->format('yyyy-MM-dd HH:mm:ss', $this->start_date_timestamp);
     return parent::beforeValidate();
 }