@wernfried/daterangepicker 5.2.14 → 5.2.17
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 +10 -4
- package/dist/cjs/daterangepicker.cjs.map +1 -1
- package/dist/cjs/daterangepicker.min.cjs +2 -2
- package/dist/cjs/daterangepicker.min.cjs.map +1 -1
- package/dist/esm/daterangepicker.js +10 -4
- package/dist/esm/daterangepicker.js.map +1 -1
- package/dist/esm/daterangepicker.min.js +2 -2
- package/dist/esm/daterangepicker.min.js.map +1 -1
- package/dist/global/daterangepicker.js +10 -4
- package/dist/global/daterangepicker.js.map +1 -1
- package/dist/global/daterangepicker.min.js +2 -2
- package/dist/global/daterangepicker.min.js.map +1 -1
- package/package.json +2 -2
|
@@ -1088,9 +1088,9 @@ class DateRangePicker {
|
|
|
1088
1088
|
if (endDate < minDate) {
|
|
1089
1089
|
violation = { old: endDate, reason: "minSpan" };
|
|
1090
1090
|
if (this.defaultSpan) {
|
|
1091
|
-
endDate =
|
|
1091
|
+
endDate = startDate.plus({ seconds: Math.trunc(this.defaultSpan.as("seconds") / shiftStep) * shiftStep });
|
|
1092
1092
|
} else {
|
|
1093
|
-
endDate =
|
|
1093
|
+
endDate = startDate.plus({ seconds: Math.trunc(this.minSpan.as("seconds") / shiftStep) * shiftStep });
|
|
1094
1094
|
}
|
|
1095
1095
|
if (endDate < minDate)
|
|
1096
1096
|
endDate = endDate.plus(this.timePicker ? this.timePickerStepSize : { days: 1 });
|
|
@@ -2041,8 +2041,14 @@ class DateRangePicker {
|
|
|
2041
2041
|
this.#startDate = this.#startDate.set({ hour, minute, second });
|
|
2042
2042
|
if (this.singleDatePicker) {
|
|
2043
2043
|
this.#endDate = this.#startDate;
|
|
2044
|
-
} else if (this.#endDate && this.#endDate.hasSame(this.#startDate, "day")
|
|
2045
|
-
this.#endDate
|
|
2044
|
+
} else if (this.#endDate && this.#endDate.hasSame(this.#startDate, "day")) {
|
|
2045
|
+
if (this.defaultSpan && this.#endDate < this.#startDate.plus(this.minSpan)) {
|
|
2046
|
+
this.#endDate = this.#startDate.plus(this.defaultSpan);
|
|
2047
|
+
} else if (this.minSpan && this.#endDate < this.#startDate.plus(this.minSpan)) {
|
|
2048
|
+
this.#endDate = this.#startDate.plus(this.minSpan);
|
|
2049
|
+
} else if (this.#endDate < this.#startDate) {
|
|
2050
|
+
this.#endDate = this.#startDate;
|
|
2051
|
+
}
|
|
2046
2052
|
}
|
|
2047
2053
|
} else if (this.#endDate) {
|
|
2048
2054
|
this.#endDate = this.#endDate.set({ hour, minute, second });
|