Time spent for subtasks are not rounded too the nearest quarter anymore

This commit is contained in:
Frederic Guillot
2016-08-31 21:32:29 -04:00
parent 0cb717f440
commit 1b6b1cc5e6
5 changed files with 10 additions and 26 deletions

View File

@@ -239,22 +239,10 @@ class DateParser extends Base
*/
public function getHours(DateTime $d1, DateTime $d2)
{
$seconds = $this->getRoundedSeconds(abs($d1->getTimestamp() - $d2->getTimestamp()));
$seconds = abs($d1->getTimestamp() - $d2->getTimestamp());
return round($seconds / 3600, 2);
}
/**
* Round the timestamp to the nearest quarter
*
* @access public
* @param integer $seconds Timestamp
* @return integer
*/
public function getRoundedSeconds($seconds)
{
return (int) round($seconds / (15 * 60)) * (15 * 60);
}
/**
* Get ISO-8601 date from user input
*