@sumaris-net/ngx-components 1.22.12-rc2 → 1.22.12

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.
@@ -2900,14 +2900,16 @@
2900
2900
  // Already a moment object: use it
2901
2901
  if (!value || momentImported.isMoment(value))
2902
2902
  return value;
2903
+ if (typeof value === 'string' && value.length === 10) {
2904
+ // Parse the input value, as a date only
2905
+ var dateOnly = moment$1(value, DATE_PATTERN);
2906
+ if (dateOnly.isValid())
2907
+ return DateUtils.markNoTime(dateOnly);
2908
+ }
2903
2909
  // Parse the input value, as a ISO date time
2904
2910
  var date = moment$1(value, DATE_ISO_PATTERN);
2905
2911
  if (date.isValid())
2906
2912
  return date;
2907
- // Parse the input value, as a date only
2908
- var dateOnly = moment$1(value, DATE_PATTERN);
2909
- if (dateOnly.isValid())
2910
- return DateUtils.markNoTime(date);
2911
2913
  // Not valid: trying to convert from unix timestamp
2912
2914
  if (typeof value === 'string') {
2913
2915
  console.warn('Wrong date format - Trying to convert from local time: ' + value);