@wernfried/daterangepicker 5.3.8 → 5.4.1

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.
@@ -315,12 +315,12 @@ var DateRangePicker = (function(exports, luxon2) {
315
315
  if (opt === "endDate" && this.singleDatePicker)
316
316
  continue;
317
317
  if (typeof options[opt] === "object") {
318
- if (luxon2.DateTime.isDateTime(options[opt]) && options[opt].isValid) {
318
+ if (options[opt] == null) {
319
+ this[opt] = null;
320
+ } else if (luxon2.DateTime.isDateTime(options[opt])) {
319
321
  this[opt] = options[opt];
320
322
  } else if (options[opt] instanceof Date) {
321
323
  this[opt] = luxon2.DateTime.fromJSDate(options[opt]);
322
- } else if (options[opt] === null) {
323
- this[opt] = null;
324
324
  } else {
325
325
  console.error(`Option '${opt}' must be a luxon.DateTime or Date or string`);
326
326
  }
@@ -617,7 +617,7 @@ var DateRangePicker = (function(exports, luxon2) {
617
617
  * // -> Calendar selects and shows "today - 3 days"
618
618
  */
619
619
  onViolate: { type: "violate", param: (violation, newDate) => {
620
- return { ...violation, ...{ cancelable: true } };
620
+ return { ...violation, cancelable: true };
621
621
  } },
622
622
  /**
623
623
  * Emitted before the calendar time picker is rendered.
@@ -1335,7 +1335,7 @@ var DateRangePicker = (function(exports, luxon2) {
1335
1335
  html += `<th class="week">${this.locale.weekLabel}</th>`;
1336
1336
  for (let [index, dayOfWeek] of this.locale.daysOfWeek.entries()) {
1337
1337
  html += "<th";
1338
- if (this.weekendDayClasses && this.weekendDayClasses.length && luxon2.Info.getWeekendWeekdays().includes(index + 1))
1338
+ if (this.weekendDayClasses && this.weekendDayClasses.length && luxon2.Info.getWeekendWeekdays().includes(calendar[0][index].weekday))
1339
1339
  html += ` class="${this.weekendDayClasses}"`;
1340
1340
  html += `>${dayOfWeek}</th>`;
1341
1341
  }