diff options
| author | jbm-odoo <jbm@odoo.com> | 2020-05-28 08:33:19 +0200 |
|---|---|---|
| committer | jbm-odoo <jbm@odoo.com> | 2020-06-15 15:50:19 +0200 |
| commit | e7dda3fab002f5db930b4af340787177d597d59e (patch) | |
| tree | d12d8fbebac30787325463f950275357bd8d0fcb /addons/timer/static | |
| parent | 3a2d698480d79368aab284e95a0e7091cd02bf64 (diff) | |
[IMP] project_timesheet: Add internal project by default to ease onboarding
taskId: 2217930
Diffstat (limited to 'addons/timer/static')
| -rw-r--r-- | addons/timer/static/src/js/timer_mixin.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/timer/static/src/js/timer_mixin.js b/addons/timer/static/src/js/timer_mixin.js index 779d06dbe4a..7a70e81341e 100644 --- a/addons/timer/static/src/js/timer_mixin.js +++ b/addons/timer/static/src/js/timer_mixin.js @@ -39,9 +39,9 @@ odoo.define('timer.Timer', function (require) { timer.addTime( moment.utc( - moment.utc(serverTime) + Math.abs(moment.utc(serverTime) .diff(moment.utc(timer_start)) - ).format("HH:mm:ss") + )).format("HH:mm:ss") ); return timer; @@ -87,7 +87,7 @@ odoo.define('timer.Timer', function (require) { hour = parseInt(hour); minute = parseInt(minute); - second = parseInt(second); + second = (second === undefined) ? 0 : parseInt(second); this.addSeconds(second); this.addMinutes(minute); @@ -99,6 +99,10 @@ odoo.define('timer.Timer', function (require) { return (this.hours * 60 + this.minutes) * 60 / 3600; } + convertToSeconds() { + return (this.hours * 60 + this.minutes) * 60 + this.seconds; + } + toString() { const time = { hours: this.display2digits(this.hours), |
