@sumaris-net/ngx-components 1.18.4 → 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,8 +2261,11 @@
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, displayFormat) {
2265
- return this.dateAdapter.format(date, displayFormat);
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);
2266
2269
  };
2267
2270
  return DateFormatPipe;
2268
2271
  }());
@@ -2769,10 +2772,10 @@
2769
2772
  this.toDuration = toDuration;
2770
2773
  }
2771
2774
  DateUtils.min = function (date1, date2) {
2772
- return date1 && date2 && date1.isSameOrBefore(date2) ? date1 : date2;
2775
+ return date1 && (!date2 || date1.isSameOrBefore(date2)) ? date1 : date2;
2773
2776
  };
2774
2777
  DateUtils.max = function (date1, date2) {
2775
- return !date1 ? date2 : (!date2 || date1.isSameOrAfter(date2) ? date1 : date2);
2778
+ return date1 && (!date2 || date1.isSameOrAfter(date2)) ? date1 : date2;
2776
2779
  };
2777
2780
  DateUtils.equals = function (date1, date2) {
2778
2781
  return DateUtils.isSame(date1, date2);