@wernfried/daterangepicker 5.2.13 → 5.2.14
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 +8 -8
- package/dist/cjs/daterangepicker.cjs +15 -9
- package/dist/cjs/daterangepicker.cjs.map +1 -1
- package/dist/cjs/daterangepicker.min.cjs +1 -1
- package/dist/cjs/daterangepicker.min.cjs.map +1 -1
- package/dist/esm/daterangepicker.js +15 -9
- package/dist/esm/daterangepicker.js.map +1 -1
- package/dist/esm/daterangepicker.min.js +1 -1
- package/dist/esm/daterangepicker.min.js.map +1 -1
- package/dist/global/daterangepicker.js +15 -9
- package/dist/global/daterangepicker.js.map +1 -1
- package/dist/global/daterangepicker.min.js +1 -1
- package/dist/global/daterangepicker.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -247,12 +247,14 @@ var DateRangePicker = (function(exports, luxon2) {
|
|
|
247
247
|
this.maxSpan = null;
|
|
248
248
|
console.warn(`Ignore option 'minSpan' and 'maxSpan', because 'minSpan' must be smaller than 'maxSpan'`);
|
|
249
249
|
}
|
|
250
|
-
if (this.defaultSpan
|
|
251
|
-
this.defaultSpan
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
this.defaultSpan
|
|
255
|
-
|
|
250
|
+
if (this.defaultSpan) {
|
|
251
|
+
if (this.minSpan && this.minSpan > this.defaultSpan) {
|
|
252
|
+
this.defaultSpan = null;
|
|
253
|
+
console.warn(`Ignore option 'defaultSpan', because 'defaultSpan' must be greater than 'minSpan'`);
|
|
254
|
+
} else if (this.maxSpan && this.maxSpan < this.defaultSpan) {
|
|
255
|
+
this.defaultSpan = null;
|
|
256
|
+
console.warn(`Ignore option 'defaultSpan', because 'defaultSpan' must be smaller than 'maxSpan'`);
|
|
257
|
+
}
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
260
|
if (this.timePicker) {
|
|
@@ -1083,10 +1085,14 @@ var DateRangePicker = (function(exports, luxon2) {
|
|
|
1083
1085
|
}
|
|
1084
1086
|
}
|
|
1085
1087
|
if (this.minSpan) {
|
|
1086
|
-
const minDate = startDate.plus(this.
|
|
1088
|
+
const minDate = startDate.plus(this.minSpan);
|
|
1087
1089
|
if (endDate < minDate) {
|
|
1088
1090
|
violation = { old: endDate, reason: "minSpan" };
|
|
1089
|
-
|
|
1091
|
+
if (this.defaultSpan) {
|
|
1092
|
+
endDate = endDate.plus({ seconds: Math.trunc(startDate.plus(this.defaultSpan).diff(endDate).as("seconds") / shiftStep) * shiftStep });
|
|
1093
|
+
} else {
|
|
1094
|
+
endDate = endDate.plus({ seconds: Math.trunc(minDate.diff(endDate).as("seconds") / shiftStep) * shiftStep });
|
|
1095
|
+
}
|
|
1090
1096
|
if (endDate < minDate)
|
|
1091
1097
|
endDate = endDate.plus(this.timePicker ? this.timePickerStepSize : { days: 1 });
|
|
1092
1098
|
violation.new = endDate;
|
|
@@ -1381,7 +1387,7 @@ var DateRangePicker = (function(exports, luxon2) {
|
|
|
1381
1387
|
if (this.maxSpan && (!this.maxDate || this.#startDate.plus(this.maxSpan) < this.maxDate))
|
|
1382
1388
|
maxDate = this.#startDate.plus(this.maxSpan);
|
|
1383
1389
|
if (this.minSpan && side === "end")
|
|
1384
|
-
minLimit = this.#startDate.plus(this.
|
|
1390
|
+
minLimit = this.#startDate.plus(this.minSpan);
|
|
1385
1391
|
if (side === "start") {
|
|
1386
1392
|
selected = this.#startDate;
|
|
1387
1393
|
minDate = this.minDate;
|