1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Working on time tracker

This commit is contained in:
Hillel Coren 2017-10-08 20:54:36 +03:00
parent 10b1bee64d
commit df6be79b99

View File

@ -778,6 +778,7 @@
self.checkForOverlaps = function() {
var lastTime = 0;
var isValid = true;
var running = [];
for (var i=0; i<self.time_log().length; i++) {
var timeLog = self.time_log()[i];
@ -791,12 +792,21 @@
endValid = false;
}
lastTime = Math.max(lastTime, timeLog.endTime());
if (timeLog.isRunning()) {
running.push(timeLog);
}
}
timeLog.isStartValid(startValid);
timeLog.isEndValid(endValid);
if (! startValid || ! endValid) {
isValid = false;
}
if (running.length > 1) {
$.each(running, function(i, time) {
time.isEndValid(false);
});
isValid = false;
}
}
return isValid;