@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.
- package/bundles/sumaris-net.ngx-components.umd.js +6 -4
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/doc/changelog.md +3 -0
- package/esm2015/src/app/shared/dates.js +8 -6
- package/esm2015/src/app/shared/material/datetime/material.datetime.js +1 -1
- package/esm2015/src/app/shared/material/datetime/testing/mat-date-time.test.js +1 -1
- package/fesm2015/sumaris-net.ngx-components.js +6 -4
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/shared/dates.d.ts +3 -2
|
@@ -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);
|