From ba42cf5d4a5b6a4d5c64918119b61527b0508007 Mon Sep 17 00:00:00 2001 From: clavay Date: Tue, 12 Sep 2023 09:24:49 +0200 Subject: [PATCH 1/4] calendar first day set first calendar day to monday --- pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js index 0d0e415f..336602f3 100644 --- a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js +++ b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js @@ -2802,7 +2802,7 @@ function createOffset(date) { "November", "December" ], - "firstDay": 1 + "firstDay": 0 }, "alwaysShowCalendars": true, "linkedCalendars": false, From 9acbe11a741bfb05cbfbc9bc452b8306bb9b23c6 Mon Sep 17 00:00:00 2001 From: clavay Date: Tue, 12 Sep 2023 09:32:31 +0200 Subject: [PATCH 2/4] fix setting text for boolean value check if the span field with class .boolean-value exist before writting the value for svg process flow diagram item the method is different so the span does not exist todo : replace value by string for process diagram items --- pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js index 336602f3..4a0e3823 100644 --- a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js +++ b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js @@ -789,7 +789,7 @@ var store_temp_ajax_data = null; } // Set the text value document.querySelector("#" + control_item_id).innerHTML = r_val + " " + unit; - }else if(typeof(val)==="boolean"){ + }else if(typeof(val)==="boolean" && e.querySelector('.boolean-value') != null){ // Set the text value e.querySelector('.boolean-value').innerHTML = ci_label + " : " + dictionary(var_id, val, type.replace('-', '')) + " " + unit; } From 77f383d74bd53deddbdc2c25c5de3ab3bad8ebd4 Mon Sep 17 00:00:00 2001 From: clavay Date: Tue, 12 Sep 2023 09:34:20 +0200 Subject: [PATCH 3/4] aggregation type check if '#aggregation-type-all-select-' + widget_id exist before adding new option --- pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js index 4a0e3823..27b32d6c 100644 --- a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js +++ b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js @@ -3001,7 +3001,7 @@ function setAggregatedLists() { b=filter_aggregation_type_for_period_list(a); for (v in b) { c[cc].add(new Option(b[v], v)); - if (!document.querySelectorAll('#aggregation-type-all-select-' + widget_id + ' option[value="' + v + '"]').length) { + if (document.querySelector('#aggregation-type-all-select-' + widget_id) != null && !document.querySelectorAll('#aggregation-type-all-select-' + widget_id + ' option[value="' + v + '"]').length) { document.querySelector('#aggregation-type-all-select-' + widget_id).add(new Option(b[v], v)); } } From 3b041ef3bf3fa7135ea20c72e8f366df4fe8fcca Mon Sep 17 00:00:00 2001 From: clavay Date: Thu, 14 Sep 2023 13:45:54 +0200 Subject: [PATCH 4/4] Fix day name order and let first day to monday The daysOfWeek order for DateTimePicker should start on sunday, if not the days are not well labeled Then the firstDay select the first day to start weeks in the calendar The first day is set to monday untill we find how to get the browser locale and use the first week day for that country --- pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js index 27b32d6c..94711e3c 100644 --- a/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js +++ b/pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js @@ -2780,13 +2780,13 @@ function createOffset(date) { "customRangeLabel": "Custom", "weekLabel": "W", "daysOfWeek": [ + "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", - "Su", ], "monthNames": [ "January", @@ -2802,7 +2802,7 @@ function createOffset(date) { "November", "December" ], - "firstDay": 0 + "firstDay": 1 }, "alwaysShowCalendars": true, "linkedCalendars": false,