FIX Total of timespent

This commit is contained in:
Laurent Destailleur 2018-10-26 15:01:50 +02:00
parent 5d249d71ca
commit 20d7c8bb8c

View File

@ -222,20 +222,21 @@ function updateTotal(days,mode)
else jQuery('.totalDay'+days).removeClass("bold");
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
var total = new Date(0);
total.setHours(0);
total.setMinutes(0);
var totalhour = 0;
var totalmin = 0;
for (var i=0; i<7; i++)
{
var taskTime= new Date(0);
result=parseTime(jQuery('.totalDay'+i).text(),taskTime);
if (result >= 0)
{
total.setHours(total.getHours()+taskTime.getHours());
total.setMinutes(total.getMinutes()+taskTime.getMinutes());
totalhour = totalhour + taskTime.getHours();
totalmin = totalmin + taskTime.getMinutes();
}
}
jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes()));
morehours = Math.floor(totalmin / 60);
totalmin = totalmin % 60;
jQuery('.totalDayAll').text(pad(morehours + totalhour)+':'+pad(totalmin));
}
else
{