@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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 34.1.29
3
+ * version : 34.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-calendars",
3
- "version": "34.1.29",
3
+ "version": "34.2.3",
4
4
  "description": "A complete package of date or time components with built-in features such as date formatting, inline editing, multiple (range) selection, range restriction, month and year selection, strict mode, and globalization.",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,11 +8,11 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-calendars.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~34.1.29",
12
- "@syncfusion/ej2-buttons": "~34.1.29",
13
- "@syncfusion/ej2-inputs": "~34.1.29",
14
- "@syncfusion/ej2-lists": "~34.1.29",
15
- "@syncfusion/ej2-popups": "~34.1.29"
11
+ "@syncfusion/ej2-base": "~34.2.2",
12
+ "@syncfusion/ej2-buttons": "~34.2.2",
13
+ "@syncfusion/ej2-inputs": "~34.2.2",
14
+ "@syncfusion/ej2-lists": "~34.2.2",
15
+ "@syncfusion/ej2-popups": "~34.2.3"
16
16
  },
17
17
  "devDependencies": {},
18
18
  "keywords": [
@@ -1836,7 +1836,9 @@ var CalendarBase = /** @class */ (function (_super) {
1836
1836
  tableBodyElement = this.tableBodyElement;
1837
1837
  }
1838
1838
  if (!multiSelection && !isNullOrUndefined(tableBodyElement.querySelector('.' + SELECTED))) {
1839
- removeClass([tableBodyElement.querySelector('.' + SELECTED)], SELECTED);
1839
+ var prevSelected = tableBodyElement.querySelector('.' + SELECTED);
1840
+ removeClass([prevSelected], SELECTED);
1841
+ prevSelected.setAttribute('aria-selected', 'false');
1840
1842
  }
1841
1843
  if (!multiSelection && !isNullOrUndefined(tableBodyElement.querySelector('.' + FOCUSEDDATE))) {
1842
1844
  removeClass([tableBodyElement.querySelector('.' + FOCUSEDDATE)], FOCUSEDDATE);
@@ -1856,10 +1858,12 @@ var CalendarBase = /** @class */ (function (_super) {
1856
1858
  if (collection[index] === selectedElement &&
1857
1859
  !this.checkPresentDate(new Date(parseInt(selectedElement.getAttribute('id').split('_')[0], 10)), values)) {
1858
1860
  removeClass([collection[index]], SELECTED);
1861
+ collection[index].setAttribute('aria-selected', 'false');
1859
1862
  }
1860
1863
  }
1861
1864
  if (element.classList.contains(SELECTED)) {
1862
1865
  removeClass([element], SELECTED);
1866
+ element.setAttribute('aria-selected', 'false');
1863
1867
  for (var i = 0; i < copyValues.length; i++) {
1864
1868
  var type = (this.calendarMode === 'Gregorian') ? 'gregorian' : 'islamic';
1865
1869
  var formatOptions = { format: null, type: 'date', skeleton: 'short', calendar: type };
@@ -1869,12 +1873,14 @@ var CalendarBase = /** @class */ (function (_super) {
1869
1873
  var index = copyValues.indexOf(copyValues[i]);
1870
1874
  copyValues.splice(index, 1);
1871
1875
  addClass([element], FOCUSEDDATE);
1876
+ element.setAttribute('aria-selected', 'true');
1872
1877
  }
1873
1878
  }
1874
1879
  this.setProperties({ values: copyValues }, true);
1875
1880
  }
1876
1881
  else {
1877
1882
  addClass([element], SELECTED);
1883
+ element.setAttribute('aria-selected', 'true');
1878
1884
  }
1879
1885
  }
1880
1886
  else {
@@ -1972,10 +1978,22 @@ var CalendarBase = /** @class */ (function (_super) {
1972
1978
  };
1973
1979
  CalendarBase.prototype.isMonthYearRange = function (date) {
1974
1980
  if (this.calendarMode === 'Gregorian') {
1975
- return date.getMonth() >= this.min.getMonth()
1976
- && date.getFullYear() >= this.min.getFullYear()
1977
- && date.getMonth() <= this.max.getMonth()
1978
- && date.getFullYear() <= this.max.getFullYear();
1981
+ var dateYear = date.getFullYear();
1982
+ var dateMonth = date.getMonth();
1983
+ var minYear = this.min.getFullYear();
1984
+ var minMonth = this.min.getMonth();
1985
+ var maxYear = this.max.getFullYear();
1986
+ var maxMonth = this.max.getMonth();
1987
+ if (dateYear < minYear || dateYear > maxYear) {
1988
+ return false;
1989
+ }
1990
+ if (dateYear === minYear && dateMonth < minMonth) {
1991
+ return false;
1992
+ }
1993
+ if (dateYear === maxYear && dateMonth > maxMonth) {
1994
+ return false;
1995
+ }
1996
+ return true;
1979
1997
  }
1980
1998
  else {
1981
1999
  var islamicDate = this.islamicModule.getIslamicDate(date);
@@ -620,6 +620,8 @@ export declare class DateRangePicker extends CalendarBase {
620
620
  private initProperty;
621
621
  protected checkFormat(): void;
622
622
  protected checkInputFormats(): void;
623
+ protected setTimeZone(): void;
624
+ protected isDayLightSaving(date: Date): boolean;
623
625
  private initialize;
624
626
  private setDataAttribute;
625
627
  private setRangeAllowEdit;
@@ -382,6 +382,29 @@ var DateRangePicker = /** @class */ (function (_super) {
382
382
  this.inputFormatsString = null;
383
383
  }
384
384
  };
385
+ DateRangePicker.prototype.setTimeZone = function () {
386
+ if (!isNullOrUndefined(this.serverTimezoneOffset)) {
387
+ if (this.startValue) {
388
+ var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
389
+ var serverTimezoneDiff = this.serverTimezoneOffset;
390
+ var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
391
+ timeZoneDiff = this.isDayLightSaving(this.startValue) ? timeZoneDiff-- : timeZoneDiff;
392
+ this.startValue = new Date((this.startValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
393
+ }
394
+ if (this.endValue) {
395
+ var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
396
+ var serverTimezoneDiff = this.serverTimezoneOffset;
397
+ var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
398
+ timeZoneDiff = this.isDayLightSaving(this.endValue) ? timeZoneDiff-- : timeZoneDiff;
399
+ this.endValue = new Date((this.endValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
400
+ }
401
+ }
402
+ };
403
+ DateRangePicker.prototype.isDayLightSaving = function (date) {
404
+ var firstOffset = new Date(date.getFullYear(), 0, 1).getTimezoneOffset();
405
+ var secondOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
406
+ return (date.getTimezoneOffset() < Math.max(firstOffset, secondOffset));
407
+ };
385
408
  DateRangePicker.prototype.initialize = function () {
386
409
  if (this.angularTag !== null) {
387
410
  this.validationAttribute(this.element, this.inputElement);
@@ -391,6 +414,7 @@ var DateRangePicker = /** @class */ (function (_super) {
391
414
  var start = this.checkDateValue(new Date(this.checkValue(this.startValue)));
392
415
  this.setProperties({ startDate: start }, true); // persist the value propeerty.
393
416
  this.setProperties({ endValue: this.checkDateValue(new Date(this.checkValue(this.endValue))) }, true);
417
+ this.setTimeZone();
394
418
  this.setValue();
395
419
  this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(this.min))) }, true);
396
420
  this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(this.max))) }, true);