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

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