Add new analytic page: Average time spent into each column

This commit is contained in:
Frederic Guillot
2015-07-05 21:22:31 -04:00
parent bb8b4c0e36
commit 663a1c20e6
11 changed files with 254 additions and 46 deletions

View File

@@ -21,6 +21,10 @@ class Dt extends \Core\Base
*/
public function duration($seconds)
{
if ($seconds == 0) {
return 0;
}
$dtF = new DateTime("@0");
$dtT = new DateTime("@$seconds");
return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');