1
0
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:
Hillel Coren 2017-10-01 20:09:53 +03:00
parent f20956732a
commit fc624d1aab

View File

@ -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>