@syncfusion/ej2-calendars 28.1.37 → 28.1.39
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/README.md +1 -1
- 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 +39 -20
- package/dist/es6/ej2-calendars.es2015.js.map +1 -1
- package/dist/es6/ej2-calendars.es5.js +38 -19
- 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 +9 -7
- package/src/daterangepicker/daterangepicker.js +38 -19
|
@@ -6294,10 +6294,8 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6294
6294
|
if (range.length > 1) {
|
|
6295
6295
|
this.invalidValueString = null;
|
|
6296
6296
|
const dateOptions = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
6297
|
-
const
|
|
6298
|
-
const
|
|
6299
|
-
const startDate = this.getStartEndDate(start, false, range, dateOptions);
|
|
6300
|
-
const endDate = this.getStartEndDate(end, true, range, dateOptions);
|
|
6297
|
+
const startDate = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
|
|
6298
|
+
const endDate = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
|
|
6301
6299
|
if (!isNullOrUndefined(startDate) && !isNaN(+startDate) && !isNullOrUndefined(endDate) && !isNaN(+endDate)) {
|
|
6302
6300
|
const prevStartVal = this.startValue;
|
|
6303
6301
|
this.startValue = startDate;
|
|
@@ -6369,14 +6367,11 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6369
6367
|
}
|
|
6370
6368
|
this.updateHiddenInput();
|
|
6371
6369
|
}
|
|
6372
|
-
getStartEndDate(date, isEnd
|
|
6373
|
-
if (this.
|
|
6374
|
-
return this.globalize.parseDate(this.getAmPmValue(range[isEnd ? 1 : 0]).trim(), dateOptions);
|
|
6375
|
-
}
|
|
6376
|
-
else if (this.depth === 'Year' && !isNullOrUndefined(date)) {
|
|
6370
|
+
getStartEndDate(date, isEnd) {
|
|
6371
|
+
if (this.currentView() === 'Year' && !isNullOrUndefined(date)) {
|
|
6377
6372
|
return new Date(date.getFullYear(), date.getMonth() + (isEnd ? 1 : 0), isEnd ? 0 : 1);
|
|
6378
6373
|
}
|
|
6379
|
-
else if (!isNullOrUndefined(date)) {
|
|
6374
|
+
else if (this.currentView() === 'Decade' && !isNullOrUndefined(date)) {
|
|
6380
6375
|
return new Date(date.getFullYear(), isEnd ? 11 : 0, isEnd ? 31 : 1);
|
|
6381
6376
|
}
|
|
6382
6377
|
else {
|
|
@@ -6865,7 +6860,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6865
6860
|
const isDisabledCell = (!ele.classList.contains(DISABLED$2) || ele.classList.contains(DATEDISABLED));
|
|
6866
6861
|
if (!ele.classList.contains(WEEKNUMBER$2) && isDisabledCell) {
|
|
6867
6862
|
const eleDate = this.getIdValue(null, ele);
|
|
6868
|
-
const startDateValue = new Date(+this.startValue);
|
|
6863
|
+
const startDateValue = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
|
|
6869
6864
|
const eleDateValue = new Date(+eleDate);
|
|
6870
6865
|
if (eleDateValue.setHours(0, 0, 0, 0) >= startDateValue.setHours(0, 0, 0, 0) && +eleDate <= +currentDate) {
|
|
6871
6866
|
addClass([ele], RANGEHOVER);
|
|
@@ -6907,9 +6902,11 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6907
6902
|
const eleDate = this.getIdValue(null, ele);
|
|
6908
6903
|
const eleDateValue = this.getIdValue(null, ele);
|
|
6909
6904
|
if (!isNullOrUndefined(this.endValue)) {
|
|
6905
|
+
const eleStartDateValue = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
|
|
6906
|
+
const eleEndDateValue = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
|
|
6910
6907
|
if (this.currentView() === this.depth &&
|
|
6911
|
-
+eleDateValue.setHours(0, 0, 0, 0) >= +
|
|
6912
|
-
&& +eleDateValue.setHours(0, 0, 0, 0) <= +
|
|
6908
|
+
+eleDateValue.setHours(0, 0, 0, 0) >= +eleStartDateValue.setHours(0, 0, 0, 0)
|
|
6909
|
+
&& +eleDateValue.setHours(0, 0, 0, 0) <= +eleEndDateValue.setHours(0, 0, 0, 0) &&
|
|
6913
6910
|
!this.isSameStartEnd(new Date(+this.startValue), new Date(+this.endValue)) &&
|
|
6914
6911
|
+new Date(+this.startValue).setHours(0, 0, 0, 0) >= +this.min
|
|
6915
6912
|
&& +new Date(+this.endValue).setHours(0, 0, 0, 0) <= +this.max
|
|
@@ -6929,7 +6926,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6929
6926
|
removeClass([ele], [RANGEHOVER]);
|
|
6930
6927
|
}
|
|
6931
6928
|
if (!ele.classList.contains(OTHERMONTH$2)) {
|
|
6932
|
-
const startDateValue = new Date(+this.startValue);
|
|
6929
|
+
const startDateValue = this.currentView() === 'Month' ? new Date(+this.startValue) : this.getStartEndDate(new Date(+this.startValue), false);
|
|
6933
6930
|
let eleDateValue = new Date(+eleDate);
|
|
6934
6931
|
if (this.currentView() === this.depth &&
|
|
6935
6932
|
+eleDateValue.setHours(0, 0, 0, 0) === +startDateValue.setHours(0, 0, 0, 0)
|
|
@@ -6940,7 +6937,7 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
6940
6937
|
addClass([ele], [STARTDATE, SELECTED$3]);
|
|
6941
6938
|
this.addSelectedAttributes(ele, this.startValue, true);
|
|
6942
6939
|
}
|
|
6943
|
-
const endDateValue = new Date(+this.endValue);
|
|
6940
|
+
const endDateValue = this.currentView() === 'Month' ? new Date(+this.endValue) : this.getStartEndDate(new Date(+this.endValue), true);
|
|
6944
6941
|
if (this.currentView() === 'Year') {
|
|
6945
6942
|
eleDateValue = new Date(eleDateValue.getFullYear(), eleDateValue.getMonth() + 1, 0);
|
|
6946
6943
|
}
|
|
@@ -7033,14 +7030,36 @@ let DateRangePicker = class DateRangePicker extends CalendarBase {
|
|
|
7033
7030
|
if (event) {
|
|
7034
7031
|
event.preventDefault();
|
|
7035
7032
|
}
|
|
7036
|
-
|
|
7033
|
+
let isValue;
|
|
7034
|
+
let startDateValue;
|
|
7035
|
+
let endDateValue;
|
|
7036
|
+
const value = this.inputElement.value;
|
|
7037
|
+
if (!isNullOrUndefined(value) && value.trim() !== '') {
|
|
7038
|
+
const range = value.split(' ' + this.separator + ' ');
|
|
7039
|
+
if (range.length > 1 && ((this.currentView() === 'Year' && this.depth === 'Year')
|
|
7040
|
+
|| (this.currentView() === 'Decade' && this.depth === 'Decade'))) {
|
|
7041
|
+
const dateOptions = { format: this.formatString, type: 'date', skeleton: 'yMd' };
|
|
7042
|
+
startDateValue = this.globalize.parseDate(this.getAmPmValue(range[0]).trim(), dateOptions);
|
|
7043
|
+
endDateValue = this.globalize.parseDate(this.getAmPmValue(range[1]).trim(), dateOptions);
|
|
7044
|
+
isValue = true;
|
|
7045
|
+
}
|
|
7046
|
+
}
|
|
7047
|
+
let date = isNullOrUndefined(event) ? this.getIdValue(null, element)
|
|
7037
7048
|
: this.getIdValue(event, null);
|
|
7049
|
+
if (!isNullOrUndefined(this.startValue)) {
|
|
7050
|
+
if (this.currentView() === 'Year' && this.depth === 'Year') {
|
|
7051
|
+
date = new Date(date.getFullYear(), date.getMonth(), this.startValue.getDate());
|
|
7052
|
+
}
|
|
7053
|
+
else if (this.currentView() === 'Decade' && this.depth === 'Decade') {
|
|
7054
|
+
date = new Date(date.getFullYear(), this.startValue.getMonth(), this.startValue.getDate());
|
|
7055
|
+
}
|
|
7056
|
+
}
|
|
7038
7057
|
const y = date.getFullYear();
|
|
7039
7058
|
const m = date.getMonth();
|
|
7040
|
-
const firstDay = new Date(y, m, 1);
|
|
7041
|
-
const lastDay = new Date(y, m + 1, 0);
|
|
7042
|
-
const firstMonth = new Date(y, 0, 1);
|
|
7043
|
-
const lastMonth = new Date(y, 11, 31);
|
|
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);
|
|
7044
7063
|
if (!isNullOrUndefined(this.endValue) && !isNullOrUndefined(this.startValue)) {
|
|
7045
7064
|
if (!this.isMobile || this.isMobile && !this.endButton.element.classList.contains(ACTIVE$1)) {
|
|
7046
7065
|
this.removeSelection();
|