willba-component-library 0.2.36 → 0.2.38

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.36",
3
+ "version": "0.2.38",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -99,7 +99,7 @@ export default function FilterCalendar({
99
99
  <div>
100
100
  <span>
101
101
  {parseDate({
102
- date: calendarRange?.from,
102
+ date: initialCalendarRange?.from || calendarRange?.from,
103
103
  dateFormat: 'EEEEEE d.M.yyyy',
104
104
  language,
105
105
  }) || t('common:checkIn')}
@@ -109,7 +109,7 @@ export default function FilterCalendar({
109
109
  </span>
110
110
  <span>
111
111
  {parseDate({
112
- date: calendarRange?.to,
112
+ date: initialCalendarRange?.to || calendarRange?.to,
113
113
  dateFormat: 'EEEEEE d.M.yyyy',
114
114
  language,
115
115
  }) || t('common:checkOut')}
@@ -58,8 +58,7 @@ export const Calendar = forwardRef<HTMLDivElement, CalendarTypes>(
58
58
  >(undefined)
59
59
 
60
60
  useMemo(() => {
61
- console.log(disableCalendarDates?.availableDates)
62
- if (disableCalendarDates?.availableDates?.length) {
61
+ if (disableCalendarDates?.availableDates) {
63
62
  const dateFormat = 'dd-MM-yyyy'
64
63
 
65
64
  const { disabledDates } = disableCalendarDates
@@ -75,18 +74,21 @@ export const Calendar = forwardRef<HTMLDivElement, CalendarTypes>(
75
74
  dateRange
76
75
  ) => {
77
76
  const formattedFromDate = format(dateRange.from, dateFormat)
78
-
79
- const hasTwoOverlappingDates = disabledDates?.some(
80
- (item) =>
81
- format(item.from, dateFormat) === formattedFromDate &&
82
- format(item.to, dateFormat) === formattedFromDate
83
- )
84
-
85
- const hasOneOverlappingDate = disabledDates?.some(
86
- (item) =>
87
- format(item.from, dateFormat) === formattedFromDate &&
88
- format(item.to, dateFormat) !== formattedFromDate
89
- )
77
+ const formattedToDate = format(dateRange.to, dateFormat)
78
+
79
+ const hasTwoOverlappingDates =
80
+ disableCalendarDates.availableDates?.some(
81
+ (item) =>
82
+ format(item.lastCheckOut, dateFormat) === formattedFromDate &&
83
+ format(item.lastCheckOut, dateFormat) === formattedToDate
84
+ )
85
+
86
+ const hasOneOverlappingDate =
87
+ disableCalendarDates.availableDates?.some(
88
+ (item) =>
89
+ format(item.lastCheckOut, dateFormat) === formattedFromDate &&
90
+ format(item.lastCheckOut, dateFormat) !== formattedToDate
91
+ )
90
92
 
91
93
  if (hasTwoOverlappingDates) {
92
94
  acc.newOverlappingDates.push(dateRange)
@@ -179,8 +181,10 @@ export const Calendar = forwardRef<HTMLDivElement, CalendarTypes>(
179
181
 
180
182
  if (loadingSpinner && calendarMonthContainer) {
181
183
  const tooltipClone: Element = loadingSpinner.cloneNode(true) as Element
184
+
182
185
  calendarMonthContainer.appendChild(tooltipClone)
183
186
  tooltipClonesSpinner.push(tooltipClone)
187
+ loadingSpinner.remove()
184
188
  }
185
189
 
186
190
  if (