summaryrefslogtreecommitdiff
path: root/app/Helper/Dt.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-05 21:22:31 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-05 21:22:31 -0400
commit663a1c20e6ba0fbf65afcb43f0f48d34f21dcb53 (patch)
tree86b86c9c83770456242fb65779aac68dc497fb54 /app/Helper/Dt.php
parentbb8b4c0e36afc05ff5b0cb3ac6465351a696b001 (diff)
Add new analytic page: Average time spent into each column
Diffstat (limited to 'app/Helper/Dt.php')
-rw-r--r--app/Helper/Dt.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Helper/Dt.php b/app/Helper/Dt.php
index be595605..b338fdc8 100644
--- a/app/Helper/Dt.php
+++ b/app/Helper/Dt.php
@@ -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');