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:
parent
10b1bee64d
commit
df6be79b99
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user