Skip to content

Commit

Permalink
If time negative return 0 see BT#11947
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Nov 7, 2016
1 parent caca50e commit 5f9fc4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main/inc/lib/api.lib.php
Expand Up @@ -7493,6 +7493,12 @@ function api_format_time($time, $originFormat = 'php')
$mins = ($time % 3600) / 60;
$secs = ($time % 60);

if ($time < 0) {
$hours = 0;
$mins = 0;
$secs = 0;
}

if ($originFormat == 'js') {
$formattedTime = trim(sprintf("%02d : %02d : %02d", $hours, $mins, $secs));
} else {
Expand Down

0 comments on commit 5f9fc4e

Please sign in to comment.