Add timer for subtasks and remove settings for subtask time tracking

This commit is contained in:
Frederic Guillot
2015-06-24 20:39:06 -04:00
parent 58c96b8c4e
commit 6efac784fc
41 changed files with 297 additions and 79 deletions

View File

@@ -10,33 +10,6 @@ namespace Helper;
*/
class Task extends \Core\Base
{
/**
* Get the age of an item in quasi human readable format.
* It's in this format: <1h , NNh, NNd
*
* @access public
* @param integer $timestamp Unix timestamp of the artifact for which age will be calculated
* @param integer $now Compare with this timestamp (Default value is the current unix timestamp)
* @return string
*/
public function age($timestamp, $now = null)
{
if ($now === null) {
$now = time();
}
$diff = $now - $timestamp;
if ($diff < 3600) {
return t('<1h');
}
else if ($diff < 86400) {
return t('%dh', $diff / 3600);
}
return t('%dd', ($now - $timestamp) / 86400);
}
public function getColors()
{
return $this->color->getList();