@syncfusion/ej2-calendars 34.1.29 → 34.2.2

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.2
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.2",
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.2"
16
16
  },
17
17
  "devDependencies": {},
18
18
  "keywords": [
@@ -1972,10 +1972,22 @@ var CalendarBase = /** @class */ (function (_super) {
1972
1972
  };
1973
1973
  CalendarBase.prototype.isMonthYearRange = function (date) {
1974
1974
  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();
1975
+ var dateYear = date.getFullYear();
1976
+ var dateMonth = date.getMonth();
1977
+ var minYear = this.min.getFullYear();
1978
+ var minMonth = this.min.getMonth();
1979
+ var maxYear = this.max.getFullYear();
1980
+ var maxMonth = this.max.getMonth();
1981
+ if (dateYear < minYear || dateYear > maxYear) {
1982
+ return false;
1983
+ }
1984
+ if (dateYear === minYear && dateMonth < minMonth) {
1985
+ return false;
1986
+ }
1987
+ if (dateYear === maxYear && dateMonth > maxMonth) {
1988
+ return false;
1989
+ }
1990
+ return true;
1979
1991
  }
1980
1992
  else {
1981
1993
  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);