@wernfried/daterangepicker 5.3.1 → 5.3.8

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.
@@ -86,7 +86,7 @@ class DateRangePicker {
86
86
  dataOptions[name] = ts.isValid && isDate ? ts : JSON.parse(item.value);
87
87
  }
88
88
  options = { ...dataOptions, ...options };
89
- if (["string", "object"].includes(typeof options.button)) {
89
+ if (["string", "object"].includes(typeof options.button) && options.button != null) {
90
90
  let button = options.button;
91
91
  if (typeof button === "string" && document.querySelectorAll(button).length === 1)
92
92
  button = document.querySelector(button);
@@ -177,7 +177,7 @@ class DateRangePicker {
177
177
  else
178
178
  console.error(`Option 'locale.direction' must be 'rtl' or 'ltr'`);
179
179
  }
180
- if (["string", "object"].includes(typeof options.locale.format))
180
+ if (["string", "object"].includes(typeof options.locale.format) && options.locale.format !== null)
181
181
  this.locale.format = options.locale.format;
182
182
  if (Array.isArray(options.locale.daysOfWeek)) {
183
183
  if (options.locale.daysOfWeek.some((x) => typeof x !== "string"))
@@ -457,7 +457,7 @@ class DateRangePicker {
457
457
  iterator--;
458
458
  }
459
459
  }
460
- if (!this.singleDatePicker && typeof options.ranges === "object") {
460
+ if (!this.singleDatePicker && typeof options.ranges === "object" && options.ranges != null) {
461
461
  for (let range in options.ranges) {
462
462
  let start, end;
463
463
  if (["string", "object"].includes(typeof options.ranges[range][0])) {