@syncfusion/ej2-calendars 34.1.29 → 34.2.3

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.
@@ -1834,7 +1834,9 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
1834
1834
  tableBodyElement = this.tableBodyElement;
1835
1835
  }
1836
1836
  if (!multiSelection && !isNullOrUndefined(tableBodyElement.querySelector('.' + SELECTED))) {
1837
- removeClass([tableBodyElement.querySelector('.' + SELECTED)], SELECTED);
1837
+ var prevSelected = tableBodyElement.querySelector('.' + SELECTED);
1838
+ removeClass([prevSelected], SELECTED);
1839
+ prevSelected.setAttribute('aria-selected', 'false');
1838
1840
  }
1839
1841
  if (!multiSelection && !isNullOrUndefined(tableBodyElement.querySelector('.' + FOCUSEDDATE))) {
1840
1842
  removeClass([tableBodyElement.querySelector('.' + FOCUSEDDATE)], FOCUSEDDATE);
@@ -1854,10 +1856,12 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
1854
1856
  if (collection[index] === selectedElement &&
1855
1857
  !this.checkPresentDate(new Date(parseInt(selectedElement.getAttribute('id').split('_')[0], 10)), values)) {
1856
1858
  removeClass([collection[index]], SELECTED);
1859
+ collection[index].setAttribute('aria-selected', 'false');
1857
1860
  }
1858
1861
  }
1859
1862
  if (element.classList.contains(SELECTED)) {
1860
1863
  removeClass([element], SELECTED);
1864
+ element.setAttribute('aria-selected', 'false');
1861
1865
  for (var i = 0; i < copyValues.length; i++) {
1862
1866
  var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
1863
1867
  var formatOptions = { format: null, type: 'date', skeleton: 'short', calendar: type };
@@ -1867,12 +1871,14 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
1867
1871
  var index = copyValues.indexOf(copyValues[i]);
1868
1872
  copyValues.splice(index, 1);
1869
1873
  addClass([element], FOCUSEDDATE);
1874
+ element.setAttribute('aria-selected', 'true');
1870
1875
  }
1871
1876
  }
1872
1877
  this.setProperties({ values: copyValues }, true);
1873
1878
  }
1874
1879
  else {
1875
1880
  addClass([element], SELECTED);
1881
+ element.setAttribute('aria-selected', 'true');
1876
1882
  }
1877
1883
  }
1878
1884
  else {
@@ -1970,10 +1976,22 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
1970
1976
  };
1971
1977
  CalendarBase.prototype.isMonthYearRange = function (date) {
1972
1978
  if (this.calendarMode === 'Gregorian') {
1973
- return date.getMonth() >= this.min.getMonth()
1974
- && date.getFullYear() >= this.min.getFullYear()
1975
- && date.getMonth() <= this.max.getMonth()
1976
- && date.getFullYear() <= this.max.getFullYear();
1979
+ var dateYear = date.getFullYear();
1980
+ var dateMonth = date.getMonth();
1981
+ var minYear = this.min.getFullYear();
1982
+ var minMonth = this.min.getMonth();
1983
+ var maxYear = this.max.getFullYear();
1984
+ var maxMonth = this.max.getMonth();
1985
+ if (dateYear < minYear || dateYear > maxYear) {
1986
+ return false;
1987
+ }
1988
+ if (dateYear === minYear && dateMonth < minMonth) {
1989
+ return false;
1990
+ }
1991
+ if (dateYear === maxYear && dateMonth > maxMonth) {
1992
+ return false;
1993
+ }
1994
+ return true;
1977
1995
  }
1978
1996
  else {
1979
1997
  var islamicDate = this.islamicModule.getIslamicDate(date);
@@ -5994,6 +6012,29 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
5994
6012
  this.inputFormatsString = null;
5995
6013
  }
5996
6014
  };
6015
+ DateRangePicker.prototype.setTimeZone = function () {
6016
+ if (!isNullOrUndefined(this.serverTimezoneOffset)) {
6017
+ if (this.startValue) {
6018
+ var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
6019
+ var serverTimezoneDiff = this.serverTimezoneOffset;
6020
+ var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
6021
+ timeZoneDiff = this.isDayLightSaving(this.startValue) ? timeZoneDiff-- : timeZoneDiff;
6022
+ this.startValue = new Date((this.startValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
6023
+ }
6024
+ if (this.endValue) {
6025
+ var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
6026
+ var serverTimezoneDiff = this.serverTimezoneOffset;
6027
+ var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
6028
+ timeZoneDiff = this.isDayLightSaving(this.endValue) ? timeZoneDiff-- : timeZoneDiff;
6029
+ this.endValue = new Date((this.endValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
6030
+ }
6031
+ }
6032
+ };
6033
+ DateRangePicker.prototype.isDayLightSaving = function (date) {
6034
+ var firstOffset = new Date(date.getFullYear(), 0, 1).getTimezoneOffset();
6035
+ var secondOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
6036
+ return (date.getTimezoneOffset() < Math.max(firstOffset, secondOffset));
6037
+ };
5997
6038
  DateRangePicker.prototype.initialize = function () {
5998
6039
  if (this.angularTag !== null) {
5999
6040
  this.validationAttribute(this.element, this.inputElement);
@@ -6003,6 +6044,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
6003
6044
  var start = this.checkDateValue(new Date(this.checkValue(this.startValue)));
6004
6045
  this.setProperties({ startDate: start }, true); // persist the value propeerty.
6005
6046
  this.setProperties({ endValue: this.checkDateValue(new Date(this.checkValue(this.endValue))) }, true);
6047
+ this.setTimeZone();
6006
6048
  this.setValue();
6007
6049
  this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(this.min))) }, true);
6008
6050
  this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(this.max))) }, true);