From 5ee8570ea8049522ef376b991abecc9c6040f848 Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Wed, 1 Dec 2021 21:28:39 +0100 Subject: [PATCH 1/2] fix clock issue --- htdocs/timesheet/core/js/stopWatch.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/timesheet/core/js/stopWatch.js b/htdocs/timesheet/core/js/stopWatch.js index e207ecc..c04a636 100644 --- a/htdocs/timesheet/core/js/stopWatch.js +++ b/htdocs/timesheet/core/js/stopWatch.js @@ -62,7 +62,11 @@ class Stopwatch { //var date_now.setTime(performance.now()); this.timestampHeartbeart=performance.now(); this.timestampClock=performance.now(); - this.time =performance.now()+ (this.event.date_time_event_start-this.event.processedTime)*1000; + if(typeof this.time === 'undefined' || this.time == 0) { + this.time = (this.event.date_time_event_start-this.event.processedTime)*1000; + }else{ + this.time = performance.now(); + } if (this.event.event_type<3 && this.event.event_type!=0) { // launch the clock for heartbeat and this.running = true; From d63fb5611803a80dcd73e8a78ba2e87543391837 Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Wed, 1 Dec 2021 21:31:48 +0100 Subject: [PATCH 2/2] rev 4.4.11 --- htdocs/timesheet/ChangeLog.md | 3 +++ htdocs/timesheet/core/modules/modtimesheet.class.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/timesheet/ChangeLog.md b/htdocs/timesheet/ChangeLog.md index 7bb26db..f5f5100 100644 --- a/htdocs/timesheet/ChangeLog.md +++ b/htdocs/timesheet/ChangeLog.md @@ -1,4 +1,7 @@ # dolibarr_project_timesheet changelog +4.4.10 (2021-12-01) +- fix the watch clock issue (going way to fast) + 4.4.10 (2021-10-16) - fix sendapproval - Fix: User rights for viewing PDF. #165 diff --git a/htdocs/timesheet/core/modules/modtimesheet.class.php b/htdocs/timesheet/core/modules/modtimesheet.class.php index dd982a0..da6bc73 100644 --- a/htdocs/timesheet/core/modules/modtimesheet.class.php +++ b/htdocs/timesheet/core/modules/modtimesheet.class.php @@ -54,7 +54,7 @@ public function __construct($db) $this->editor_name = 'Patrick Delcroix'; $this->editor_url = 'https://github.com/delcroip'; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = '4.4.10'; + $this->version = '4.4.11'; // Key used in llx_cons table to save module status enabled/disabled(where timesheet is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page(0=common, 1=interface, 2=others, 3=very specific)