primeng 21.1.8 → 21.1.9

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.
@@ -2357,7 +2357,7 @@ class DatePicker extends BaseInput {
2357
2357
  value = this.value[this.value.length - 1];
2358
2358
  }
2359
2359
  }
2360
- const valueDateString = value ? value.toDateString() : null;
2360
+ const valueDateString = value && isDate(value) ? value.toDateString() : null;
2361
2361
  let isMinDate = this.minDate && valueDateString && this.minDate.toDateString() === valueDateString;
2362
2362
  let isMaxDate = this.maxDate && valueDateString && this.maxDate.toDateString() === valueDateString;
2363
2363
  if (isMinDate) {
@@ -2424,7 +2424,7 @@ class DatePicker extends BaseInput {
2424
2424
  }
2425
2425
  toggleAMPMIfNotMinDate(newPM) {
2426
2426
  let value = this.value;
2427
- const valueDateString = value ? value.toDateString() : null;
2427
+ const valueDateString = value && isDate(value) ? value.toDateString() : null;
2428
2428
  let isMinDate = this.minDate && valueDateString && this.minDate.toDateString() === valueDateString;
2429
2429
  if (isMinDate && this.minDate.getHours() >= 12) {
2430
2430
  this.pm = true;
@@ -2534,7 +2534,7 @@ class DatePicker extends BaseInput {
2534
2534
  if (this.isMultipleSelection()) {
2535
2535
  value = this.value[this.value.length - 1];
2536
2536
  }
2537
- value = value ? new Date(value.getTime()) : new Date();
2537
+ value = value && isDate(value) ? new Date(value.getTime()) : new Date();
2538
2538
  if (this.hourFormat == '12') {
2539
2539
  if (this.currentHour === 12)
2540
2540
  value.setHours(this.pm ? 12 : 0);