@wernfried/daterangepicker 5.2.5 → 5.2.6
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 +7 -4
- 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 +7 -4
- 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 +7 -4
- 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
|
@@ -65,8 +65,7 @@ class DateRangePicker {
|
|
|
65
65
|
};
|
|
66
66
|
if (this.element == null)
|
|
67
67
|
return;
|
|
68
|
-
this.callback =
|
|
69
|
-
};
|
|
68
|
+
this.callback = null;
|
|
70
69
|
this.isShowing = false;
|
|
71
70
|
this.leftCalendar = {};
|
|
72
71
|
this.rightCalendar = {};
|
|
@@ -879,6 +878,8 @@ class DateRangePicker {
|
|
|
879
878
|
* @returns {string} - Formatted date string
|
|
880
879
|
*/
|
|
881
880
|
formatDate(date, format = this.locale.format) {
|
|
881
|
+
if (date === null)
|
|
882
|
+
return null;
|
|
882
883
|
if (typeof format === "object") {
|
|
883
884
|
return date.toLocaleString(format);
|
|
884
885
|
} else {
|
|
@@ -1655,8 +1656,10 @@ class DateRangePicker {
|
|
|
1655
1656
|
this.#startDate = this.oldStartDate;
|
|
1656
1657
|
this.#endDate = this.oldEndDate;
|
|
1657
1658
|
}
|
|
1658
|
-
if (
|
|
1659
|
-
this.
|
|
1659
|
+
if (typeof this.callback === "function") {
|
|
1660
|
+
if (this.#startDate && !this.#startDate.equals(this.oldStartDate ?? DateTime) || this.#endDate && !this.singleDatePicker && !this.#endDate.equals(this.oldEndDate ?? DateTime))
|
|
1661
|
+
this.callback(this.startDate, this.endDate, this.chosenLabel);
|
|
1662
|
+
}
|
|
1660
1663
|
this.updateElement();
|
|
1661
1664
|
const event = this.triggerEvent(this.#events.onBeforeHide);
|
|
1662
1665
|
if (event.defaultPrevented)
|