Fix calculation of the relative deadline date (today, yesterday,
tomorrow), using client time zone
This commit is contained in:
parent
9dc73a3943
commit
d96dfdbc89
|
|
@ -273,10 +273,10 @@ class TaskSummary extends TaskModel {
|
||||||
if ($this->isEmpty('deadline')) {
|
if ($this->isEmpty('deadline')) {
|
||||||
$this->_diff = 9999;
|
$this->_diff = 9999;
|
||||||
} else {
|
} else {
|
||||||
$dead = strtotime($this->get('deadline'));
|
$dead = date_timestamp_get(new DateTime($this->get('deadline'), $GLOBALS['config']['datetime']['timezone_user']));
|
||||||
// -TODO- optimize ! maybe using DateTime diff ?
|
// -TODO- optimize ! maybe using DateTime diff ?
|
||||||
$usernow = date_timestamp_get(new DateTime('now', $GLOBALS['config']['datetime']['timezone_user']));
|
$usernow = date_timestamp_get(new DateTime('now'));
|
||||||
$this->_diff = round(($dead - $usernow) / 3600 / 24);
|
$this->_diff = ceil(($dead - $usernow) / 3600 / 24);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,4 +423,4 @@ class TaskSummary extends TaskModel {
|
||||||
return parent::loadList(false);
|
return parent::loadList(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue