@fluxhub/fluxhub-lib 9.0.55 → 9.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -928,11 +928,13 @@
928
928
  integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, '.');
929
929
  return integer + fraction;
930
930
  };
931
- UtilityService.prototype.format2cifre = function (n) {
932
- if (n < 10)
933
- return '0' + String(n);
934
- else
935
- return String(n);
931
+ UtilityService.prototype.left_pad = function (n, size, charc) {
932
+ if (size === void 0) { size = 2; }
933
+ if (charc === void 0) { charc = '0'; }
934
+ var s = n + '';
935
+ while (s.length < size)
936
+ s = charc + s;
937
+ return s;
936
938
  };
937
939
  UtilityService.prototype.datetime2GanttString = function (dt) {
938
940
  var mm = dt.getMonth() + 1; // getMonth() is zero-based
@@ -1012,7 +1014,7 @@
1012
1014
  : '0') + mm,
1013
1015
  '-',
1014
1016
  dt.getFullYear()
1015
- ].join('') + " " + this.format2cifre(dt.getHours()) + ":" + this.format2cifre(dt.getMinutes()) + ":" + this.format2cifre(dt.getSeconds());
1017
+ ].join('') + " " + this.left_pad(dt.getHours()) + ":" + this.left_pad(dt.getMinutes()) + ":" + this.left_pad(dt.getSeconds());
1016
1018
  if (this.app_s.SQL_SERVER_LANG == 'uk')
1017
1019
  return [
1018
1020
  dt.getFullYear(),
@@ -1024,7 +1026,7 @@
1024
1026
  (dd > 9
1025
1027
  ? ''
1026
1028
  : '0') + dd
1027
- ].join('') + " " + this.format2cifre(dt.getHours()) + ":" + this.format2cifre(dt.getMinutes()) + ":" + this.format2cifre(dt.getSeconds());
1029
+ ].join('') + " " + this.left_pad(dt.getHours()) + ":" + this.left_pad(dt.getMinutes()) + ":" + this.left_pad(dt.getSeconds());
1028
1030
  return "Parametro SQL_SERVER_LANG non corretto";
1029
1031
  };
1030
1032
  UtilityService.prototype.descriMese = function (date) {
@@ -6850,25 +6852,27 @@
6850
6852
  if (this.sItem != '') {
6851
6853
  this.searchItemsFiltered = [];
6852
6854
  var ps = this.sItem.toLowerCase();
6853
- for (var i = 0; i < this.myData.length; i++) {
6854
- if (this.myData[i].descrizione_valore != null) {
6855
- if (this.myData[i].descrizione_valore.toLowerCase().indexOf(ps) != -1) {
6856
- this.searchItemsFiltered.push(this.myData[i]);
6855
+ if (this.myData != null)
6856
+ for (var i = 0; i < this.myData.length; i++) {
6857
+ if (this.myData[i].descrizione_valore != null) {
6858
+ if (this.myData[i].descrizione_valore.toLowerCase().indexOf(ps) != -1) {
6859
+ this.searchItemsFiltered.push(this.myData[i]);
6860
+ }
6861
+ }
6862
+ if (ps.length < 4 && this.searchItemsFiltered.length == 20) {
6863
+ break;
6857
6864
  }
6858
6865
  }
6859
- if (ps.length < 4 && this.searchItemsFiltered.length == 20) {
6860
- break;
6861
- }
6862
- }
6863
6866
  }
6864
6867
  else {
6865
6868
  // console.log('onChange()1');
6866
- for (var i = 0; i < this.myData.length; i++) {
6867
- this.searchItemsFiltered.push(this.myData[i]);
6868
- if (i == 20) {
6869
- break;
6869
+ if (this.myData != null)
6870
+ for (var i = 0; i < this.myData.length; i++) {
6871
+ this.searchItemsFiltered.push(this.myData[i]);
6872
+ if (i == 20) {
6873
+ break;
6874
+ }
6870
6875
  }
6871
- }
6872
6876
  }
6873
6877
  }
6874
6878
  };
@@ -6987,15 +6991,16 @@
6987
6991
  if (this.myData.length == 0 || this.myData[0] == null) {
6988
6992
  return;
6989
6993
  }
6990
- for (var j = 0; j < this.myData.length; j++)
6991
- if (this.myData[j].descrizione_valore == desc_val) {
6992
- this.sItem = desc_val;
6993
- this.selval = this.myData[j].valore;
6994
- if (this.sItem != null) {
6995
- this.descri_val = this.sItem;
6994
+ if (this.myData != null)
6995
+ for (var j = 0; j < this.myData.length; j++)
6996
+ if (this.myData[j].descrizione_valore == desc_val) {
6997
+ this.sItem = desc_val;
6998
+ this.selval = this.myData[j].valore;
6999
+ if (this.sItem != null) {
7000
+ this.descri_val = this.sItem;
7001
+ }
7002
+ return;
6996
7003
  }
6997
- return;
6998
- }
6999
7004
  if (!this.only_from_list) {
7000
7005
  this.sItem = desc_val;
7001
7006
  }