Page 1 of 1

Time Caclulation Errors

PostPosted: 12.04.2015, 18:56
by semide
I just updated to latest Collabtive 2.1. Immediately ran into a problem entering a job -

I bill in .25 hour increments. The Project Screen -> Timetracker pane will only record time in whole hours. If the start time is entered as 8:00, and I enter 8:15 in end time, when I tab out the end time reverts to 8:00.

If I manually enter .25 into the Hours input, the end time input shows NaN:00 and the record refuses to save.

I can enter the time as an hour, and edit the entry in the Timetracker window, but that is not very efficient.

Any ideas how to fix this?

Re: Time Caclulation Errors

PostPosted: 14.04.2015, 08:21
by Eva
Which browser did you use?

Re: Time Caclulation Errors

PostPosted: 21.04.2015, 15:11
by semide
Chrome, Firefox, and Safari.

Relevant Javascript seems to parse all time as int, which I believe would remove minutes, and for display add ":00" to result, if I read this correctly.

Code:

function populateEndtime()
{
var startVal = parseInt($('started').value,10);
var hrsVal = parseInt($('workhours').value,10);

var finVal = startVal + hrsVal;

finVal = zeroFill(finVal,2);
$('ended').value = finVal + ":00";
}
function populateHours()
{
var startVal = parseInt($('started').value,10);
var endVal = parseInt($('ended').value,10);
var hrsVal = parseInt($('workhours').value,10);

var finVal = endVal - startVal;
if(hrsVal != finVal && finVal >= 0)
{
$('workhours').value = finVal;
}
}

Re: Time Caclulation Errors

PostPosted: 27.04.2015, 19:34
by semide
Bump. Any ideas here?

Re: Time Caclulation Errors

PostPosted: 28.04.2015, 00:56
by Eva
I have a solution for you that works:

Use pre-filled start time: 08:00
Enter end time manually: 08:15 - Now DON'T leave the field via tab, but click in the comment field or the submit button via mouse!!! :D

(It doesn't matter that the time elapsed field still says 0 hours.)