Date validation in the Issue model

This commit is contained in:
Simon Holywell 2012-04-26 16:22:11 +01:00
parent 2bd2b3a463
commit fde3a0a949

View File

@ -162,10 +162,8 @@ class IDF_Issue extends Pluf_Model
$this->creation_dtime = gmdate('Y-m-d H:i:s'); $this->creation_dtime = gmdate('Y-m-d H:i:s');
} }
if ($this->due_dtime and !empty($this->due_dtime)) { if ($this->due_dtime and !empty($this->due_dtime)) {
$datetime = $this->due_dtime . ' 23:59:59'; $this->due_dtime = date('Y-m-d 23:59:59',
if(date('Y-m-d', strtotime($datetime)) === $this->due_dtime) { strtotime($this->due_dtime));
$this->due_dtime = $datetime;
}
} }
$this->modif_dtime = gmdate('Y-m-d H:i:s'); $this->modif_dtime = gmdate('Y-m-d H:i:s');
} }