willba-component-library 0.2.62 → 0.2.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.2.62",
3
+ "version": "0.2.63",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -121,6 +121,14 @@ export const Calendar = forwardRef<HTMLDivElement, CalendarTypes>(
121
121
  calendarHasError,
122
122
  })
123
123
 
124
+ // Find last possible checkout for dates
125
+ const lastPossibleCheckout = !!newDisableCalendarDates?.availableDates
126
+ ?.length
127
+ ? newDisableCalendarDates?.availableDates[
128
+ newDisableCalendarDates.availableDates.length - 1
129
+ ].lastCheckOut
130
+ : null
131
+
124
132
  return (
125
133
  <div className="will-filter-bar-calendar" ref={ref}>
126
134
  <div className="will-calendar-filter-container">
@@ -147,12 +155,14 @@ export const Calendar = forwardRef<HTMLDivElement, CalendarTypes>(
147
155
  ? disabledDatesByPage
148
156
  : disabledDates?.length
149
157
  ? [
158
+ lastPossibleCheckout ? { after: lastPossibleCheckout } : [],
150
159
  ...disabledDates,
151
160
  ...firstPossibleRangeContextCheckIn,
152
161
  ...lastPossibleRangeContextCheckOut,
153
162
  ]
154
163
  : newDisableCalendarDates?.disabledDates?.length
155
164
  ? [
165
+ lastPossibleCheckout ? { after: lastPossibleCheckout } : [],
156
166
  ...newDisableCalendarDates.disabledDates,
157
167
  ...firstPossibleRangeContextCheckIn,
158
168
  ...lastPossibleRangeContextCheckOut,