@sumaris-net/ngx-components 1.18.6 → 1.18.7

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.
@@ -2261,6 +2261,12 @@
2261
2261
  var date = momentImported.isMoment(value) ? value : this.dateAdapter.parse(value, DATE_ISO_PATTERN);
2262
2262
  return date && this.dateAdapter.format(date, pattern) || '';
2263
2263
  };
2264
+ DateFormatPipe.prototype.format = function (date, pattern) {
2265
+ return this.dateAdapter.format(date, pattern);
2266
+ };
2267
+ DateFormatPipe.prototype.parse = function (value, parseFormat) {
2268
+ return momentImported.isMoment(value) ? value : this.dateAdapter.parse(value, parseFormat || DATE_ISO_PATTERN);
2269
+ };
2264
2270
  return DateFormatPipe;
2265
2271
  }());
2266
2272
  DateFormatPipe.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DateFormatPipe_Factory() { return new DateFormatPipe(i0__namespace.ɵɵinject(i1__namespace.MomentDateAdapter), i0__namespace.ɵɵinject(i1__namespace$1.TranslateService)); }, token: DateFormatPipe, providedIn: "root" });
@@ -2766,10 +2772,10 @@
2766
2772
  this.toDuration = toDuration;
2767
2773
  }
2768
2774
  DateUtils.min = function (date1, date2) {
2769
- return date1 && date2 && date1.isSameOrBefore(date2) ? date1 : date2;
2775
+ return date1 && (!date2 || date1.isSameOrBefore(date2)) ? date1 : date2;
2770
2776
  };
2771
2777
  DateUtils.max = function (date1, date2) {
2772
- return !date1 ? date2 : (!date2 || date1.isSameOrAfter(date2) ? date1 : date2);
2778
+ return date1 && (!date2 || date1.isSameOrAfter(date2)) ? date1 : date2;
2773
2779
  };
2774
2780
  DateUtils.equals = function (date1, date2) {
2775
2781
  return DateUtils.isSame(date1, date2);