mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Working on the time tracker
This commit is contained in:
parent
f20956732a
commit
fc624d1aab
@ -983,7 +983,7 @@
|
||||
duration = Math.floor(duration / 100) / 10;
|
||||
} else {
|
||||
self.time_log().forEach(function(time){
|
||||
duration += time.duration();
|
||||
duration += time.duration.running();
|
||||
});
|
||||
}
|
||||
|
||||
@ -1173,6 +1173,19 @@
|
||||
});
|
||||
|
||||
self.duration = ko.computed({
|
||||
read: function () {
|
||||
model.clock(); // bind to the clock
|
||||
if (! self.startTime() || ! self.endTime()) {
|
||||
return false;
|
||||
}
|
||||
return self.endTime() - self.startTime();
|
||||
},
|
||||
write: function(value) {
|
||||
self.endTime(self.startTime() + value);
|
||||
}
|
||||
});
|
||||
|
||||
self.duration.running = ko.computed({
|
||||
read: function () {
|
||||
model.clock(); // bind to the clock
|
||||
if (! self.startTime()) {
|
||||
@ -1185,6 +1198,8 @@
|
||||
self.endTime(self.startTime() + value);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user