@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.
- package/dist/ej2-calendars.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js +2 -2
- package/dist/ej2-calendars.umd.min.js.map +1 -1
- package/dist/es6/ej2-calendars.es2015.js +40 -4
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +40 -4
- package/dist/es6/ej2-calendars.es5.js.map +1 -1
- package/dist/global/ej2-calendars.min.js +2 -2
- package/dist/global/ej2-calendars.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/calendar/calendar.js +16 -4
- package/src/daterangepicker/daterangepicker.d.ts +2 -0
- package/src/daterangepicker/daterangepicker.js +24 -0
|
@@ -1970,10 +1970,22 @@ var CalendarBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1970
1970
|
};
|
|
1971
1971
|
CalendarBase.prototype.isMonthYearRange = function (date) {
|
|
1972
1972
|
if (this.calendarMode === 'Gregorian') {
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1973
|
+
var dateYear = date.getFullYear();
|
|
1974
|
+
var dateMonth = date.getMonth();
|
|
1975
|
+
var minYear = this.min.getFullYear();
|
|
1976
|
+
var minMonth = this.min.getMonth();
|
|
1977
|
+
var maxYear = this.max.getFullYear();
|
|
1978
|
+
var maxMonth = this.max.getMonth();
|
|
1979
|
+
if (dateYear < minYear || dateYear > maxYear) {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
if (dateYear === minYear && dateMonth < minMonth) {
|
|
1983
|
+
return false;
|
|
1984
|
+
}
|
|
1985
|
+
if (dateYear === maxYear && dateMonth > maxMonth) {
|
|
1986
|
+
return false;
|
|
1987
|
+
}
|
|
1988
|
+
return true;
|
|
1977
1989
|
}
|
|
1978
1990
|
else {
|
|
1979
1991
|
var islamicDate = this.islamicModule.getIslamicDate(date);
|
|
@@ -5994,6 +6006,29 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
5994
6006
|
this.inputFormatsString = null;
|
|
5995
6007
|
}
|
|
5996
6008
|
};
|
|
6009
|
+
DateRangePicker.prototype.setTimeZone = function () {
|
|
6010
|
+
if (!isNullOrUndefined(this.serverTimezoneOffset)) {
|
|
6011
|
+
if (this.startValue) {
|
|
6012
|
+
var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
|
|
6013
|
+
var serverTimezoneDiff = this.serverTimezoneOffset;
|
|
6014
|
+
var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
|
|
6015
|
+
timeZoneDiff = this.isDayLightSaving(this.startValue) ? timeZoneDiff-- : timeZoneDiff;
|
|
6016
|
+
this.startValue = new Date((this.startValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
|
|
6017
|
+
}
|
|
6018
|
+
if (this.endValue) {
|
|
6019
|
+
var clientTimeZoneDiff = new Date().getTimezoneOffset() / 60;
|
|
6020
|
+
var serverTimezoneDiff = this.serverTimezoneOffset;
|
|
6021
|
+
var timeZoneDiff = serverTimezoneDiff + clientTimeZoneDiff;
|
|
6022
|
+
timeZoneDiff = this.isDayLightSaving(this.endValue) ? timeZoneDiff-- : timeZoneDiff;
|
|
6023
|
+
this.endValue = new Date((this.endValue).getTime() + (timeZoneDiff * 60 * 60 * 1000));
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
};
|
|
6027
|
+
DateRangePicker.prototype.isDayLightSaving = function (date) {
|
|
6028
|
+
var firstOffset = new Date(date.getFullYear(), 0, 1).getTimezoneOffset();
|
|
6029
|
+
var secondOffset = new Date(date.getFullYear(), 6, 1).getTimezoneOffset();
|
|
6030
|
+
return (date.getTimezoneOffset() < Math.max(firstOffset, secondOffset));
|
|
6031
|
+
};
|
|
5997
6032
|
DateRangePicker.prototype.initialize = function () {
|
|
5998
6033
|
if (this.angularTag !== null) {
|
|
5999
6034
|
this.validationAttribute(this.element, this.inputElement);
|
|
@@ -6003,6 +6038,7 @@ var DateRangePicker = /** @__PURE__ @class */ (function (_super) {
|
|
|
6003
6038
|
var start = this.checkDateValue(new Date(this.checkValue(this.startValue)));
|
|
6004
6039
|
this.setProperties({ startDate: start }, true); // persist the value propeerty.
|
|
6005
6040
|
this.setProperties({ endValue: this.checkDateValue(new Date(this.checkValue(this.endValue))) }, true);
|
|
6041
|
+
this.setTimeZone();
|
|
6006
6042
|
this.setValue();
|
|
6007
6043
|
this.setProperties({ min: this.checkDateValue(new Date(this.checkValue(this.min))) }, true);
|
|
6008
6044
|
this.setProperties({ max: this.checkDateValue(new Date(this.checkValue(this.max))) }, true);
|