Working on the time tracker

This commit is contained in:
Hillel Coren 2017-10-01 21:32:05 +03:00
parent 482b5ed0e3
commit 77cde922f7

View File

@ -548,7 +548,7 @@
self.client = ko.observable(); self.client = ko.observable();
self.project = ko.observable(); self.project = ko.observable();
self.isHovered = ko.observable(false); self.isHovered = ko.observable(false);
self.created_at = ko.observable(moment().format('YYYY-MM-DD HH:mm:ss')); self.created_at = ko.observable(moment.utc().format('YYYY-MM-DD HH:mm:ss'));
self.mapping = { self.mapping = {
'client': { 'client': {
@ -963,11 +963,8 @@
} }
self.age = ko.computed(function() { self.age = ko.computed(function() {
if (! self.time_log().length) { model.clock(); // bind to the clock
return ''; return moment.utc(self.created_at()).fromNow();
}
var time = self.firstTime();
return time.age();
}); });
self.seconds = function(total) { self.seconds = function(total) {