Example #1
0
 protected function afterFind()
 {
     // convert to display format
     if ($this->expire != null) {
         $this->expire = CDateTimeParser::parse($this->expire, 'yyyy-MM-dd');
         $this->expire = Yii::app()->dateFormatter->format('dd/MM/yyyy', $this->expire);
     }
     if ($this->start != null) {
         $this->start = CDateTimeParser::parse($this->start, 'yyyy-MM-dd');
         $this->start = Yii::app()->dateFormatter->format('dd/MM/yyyy', $this->start);
     }
     if ($this->duration != null) {
         $this->duration = $this->duration / 1000;
     }
     parent::afterFind();
 }
Example #2
0
 protected function afterFind()
 {
     // convert to display format
     if ($this->end_date != null) {
         $this->end_date_timestamp = CDateTimeParser::parse($this->end_date, 'yyyy-MM-dd HH:mm:ss');
         $this->end_date = Yii::app()->dateFormatter->format('dd/MM/yyyy HH:mm', $this->end_date_timestamp);
     }
     if ($this->start_date != null) {
         $this->start_date_timestamp = CDateTimeParser::parse($this->start_date, 'yyyy-MM-dd HH:mm:ss');
         $this->start_date = Yii::app()->dateFormatter->format('dd/MM/yyyy HH:mm', $this->start_date_timestamp);
     }
     parent::afterFind();
 }