@syncfusion/ej2-calendars 28.2.3 → 28.2.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.
@@ -6295,7 +6295,12 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
6295
6295
  this.invalidValueString = null;
6296
6296
  const dateOptions = { format: this.formatString, type: 'date', skeleton: 'yMd' };
6297
6297
  const startDate = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
6298
- const endDate = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
6298
+ let endDate = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
6299
+ if (this.start !== 'Decade' && this.start === 'Year' && this.depth !== 'Month') {
6300
+ if (this.inputElement.defaultValue !== value) {
6301
+ endDate = this.getStartEndDate(endDate, true);
6302
+ }
6303
+ }
6299
6304
  if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
6300
6305
  const prevStartVal = this.startValue;
6301
6306
  this.startValue = startDate;
@@ -7056,10 +7061,10 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
7056
7061
  }
7057
7062
  const y = date.getFullYear();
7058
7063
  const m = date.getMonth();
7059
- const firstDay = isValue ? new Date(y, m, startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, m, 1);
7060
- const lastDay = isValue ? new Date(y, m, endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, m + 1, 0);
7061
- const firstMonth = isValue ? new Date(y, startDateValue.getMonth(), startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, 0, 1);
7062
- const lastMonth = isValue ? new Date(y, endDateValue.getMonth(), endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, 11, 31);
7064
+ const firstDay = isValue && this.start !== 'Year' ? new Date(y, m, startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, m, 1);
7065
+ const lastDay = isValue && this.start !== 'Year' ? new Date(y, m, endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, m + 1, 0);
7066
+ const firstMonth = isValue && this.start !== 'Year' ? new Date(y, startDateValue.getMonth(), startDateValue.getDate(), startDateValue.getHours(), startDateValue.getMinutes(), startDateValue.getSeconds()) : new Date(y, 0, 1);
7067
+ const lastMonth = isValue && this.start !== 'Year' ? new Date(y, endDateValue.getMonth(), endDateValue.getDate(), endDateValue.getHours(), endDateValue.getMinutes(), endDateValue.getSeconds()) : new Date(y, 11, 31);
7063
7068
  if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
7064
7069
  if (!this.isMobile || this.isMobile && !this.endButton.element.classList.contains(ACTIVE$1)) {
7065
7070
  this.removeSelection();
@@ -14652,7 +14657,9 @@ class MaskedDateTime {
14652
14657
  }
14653
14658
  else {
14654
14659
  this.isDayPart = false;
14655
- this.dayTypeCount = this.isDateZero ? this.dayTypeCount + 1 : this.dayTypeCount;
14660
+ if (!(this.dayTypeCount === 1 && this.isDateZero)) {
14661
+ this.dayTypeCount += this.isDateZero ? 1 : 0;
14662
+ }
14656
14663
  }
14657
14664
  break;
14658
14665
  }
@@ -14706,7 +14713,9 @@ class MaskedDateTime {
14706
14713
  newDateValue.setMonth(0);
14707
14714
  this.isLeadingZero = true;
14708
14715
  this.isMonthPart = false;
14709
- this.monthTypeCount = this.isMonthZero ? this.monthTypeCount + 1 : this.monthTypeCount;
14716
+ if (!(this.monthTypeCount === 1 && this.isMonthZero)) {
14717
+ this.monthTypeCount += this.isMonthZero ? 1 : 0;
14718
+ }
14710
14719
  }
14711
14720
  }
14712
14721
  else {