@fluxhub/fluxhub-lib 9.0.55 → 9.0.56

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.
@@ -795,11 +795,13 @@ var UtilityService = /** @class */ (function () {
795
795
  integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, '.');
796
796
  return integer + fraction;
797
797
  };
798
- UtilityService.prototype.format2cifre = function (n) {
799
- if (n < 10)
800
- return '0' + String(n);
801
- else
802
- return String(n);
798
+ UtilityService.prototype.left_pad = function (n, size, charc) {
799
+ if (size === void 0) { size = 2; }
800
+ if (charc === void 0) { charc = '0'; }
801
+ var s = n + '';
802
+ while (s.length < size)
803
+ s = charc + s;
804
+ return s;
803
805
  };
804
806
  UtilityService.prototype.datetime2GanttString = function (dt) {
805
807
  var mm = dt.getMonth() + 1; // getMonth() is zero-based
@@ -879,7 +881,7 @@ var UtilityService = /** @class */ (function () {
879
881
  : '0') + mm,
880
882
  '-',
881
883
  dt.getFullYear()
882
- ].join('') + " " + this.format2cifre(dt.getHours()) + ":" + this.format2cifre(dt.getMinutes()) + ":" + this.format2cifre(dt.getSeconds());
884
+ ].join('') + " " + this.left_pad(dt.getHours()) + ":" + this.left_pad(dt.getMinutes()) + ":" + this.left_pad(dt.getSeconds());
883
885
  if (this.app_s.SQL_SERVER_LANG == 'uk')
884
886
  return [
885
887
  dt.getFullYear(),
@@ -891,7 +893,7 @@ var UtilityService = /** @class */ (function () {
891
893
  (dd > 9
892
894
  ? ''
893
895
  : '0') + dd
894
- ].join('') + " " + this.format2cifre(dt.getHours()) + ":" + this.format2cifre(dt.getMinutes()) + ":" + this.format2cifre(dt.getSeconds());
896
+ ].join('') + " " + this.left_pad(dt.getHours()) + ":" + this.left_pad(dt.getMinutes()) + ":" + this.left_pad(dt.getSeconds());
895
897
  return "Parametro SQL_SERVER_LANG non corretto";
896
898
  };
897
899
  UtilityService.prototype.descriMese = function (date) {