@sumaris-net/ngx-components 2.6.2 → 2.6.4-rc1

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.
@@ -2750,12 +2750,12 @@ function fromDateISOString(value) {
2750
2750
  return value;
2751
2751
  if (typeof value === 'string' && value.length === 10) {
2752
2752
  // Parse the input value, as a date only
2753
- const dateOnly = DateUtils.moment(value, DATE_PATTERN);
2753
+ const dateOnly = DateUtils.moment(value, DATE_PATTERN, true);
2754
2754
  if (dateOnly.isValid())
2755
2755
  return DateUtils.markNoTime(dateOnly);
2756
2756
  }
2757
2757
  // Parse the input value, as a ISO date time
2758
- const date = DateUtils.moment(value, DATE_ISO_PATTERN);
2758
+ const date = DateUtils.moment(value, DATE_ISO_PATTERN, true);
2759
2759
  if (date.isValid())
2760
2760
  return date;
2761
2761
  // Not valid: trying to convert from unix timestamp
@@ -3647,7 +3647,7 @@ class SharedValidators {
3647
3647
  }
3648
3648
  static validDate(control) {
3649
3649
  const value = control.value;
3650
- const date = !value || isMoment(value) ? value : DateUtils.moment(value, DATE_ISO_PATTERN, true);
3650
+ const date = !value || isMoment(value) ? value : fromDateISOString(value);
3651
3651
  if (date && (!date.isValid() || date.year() < 1900)) {
3652
3652
  return { validDate: true };
3653
3653
  }