Compare commits
2 commits
42d7eaaadd
...
fa7436a499
| Author | SHA1 | Date | |
|---|---|---|---|
| fa7436a499 | |||
| d8141b4485 |
1 changed files with 13 additions and 2 deletions
|
|
@ -106,8 +106,19 @@ function isDateDisabled(d: DateValue): boolean {
|
|||
if (y < todayYmd) return true
|
||||
const start = activeStart.value
|
||||
if (!start) {
|
||||
// Picking a check-in: occupied nights are out; everything else is fair.
|
||||
return props.nightSet.has(y) && !(bothSet.value && y === props.checkOut)
|
||||
// Picking a check-in. An occupied night is out — except a committed
|
||||
// check-out that landed on one, which must stay rendered as selected.
|
||||
if (props.nightSet.has(y)) return !(bothSet.value && y === props.checkOut)
|
||||
// A free day is only a valid check-in if a minimum stay fits before the
|
||||
// next occupied night AND within the loaded window. Otherwise reka would
|
||||
// offer it, then strand the guest with no reachable check-out (every
|
||||
// later day disabled), so the only click left is an earlier day, which
|
||||
// reka silently swaps into the range. Disable it up front instead.
|
||||
const minCheckOut = addDays(y, props.minNights)
|
||||
const nextOccupied = nextUnavailableOnOrAfter(props.nights, y)
|
||||
if (nextOccupied && nextOccupied < minCheckOut) return true
|
||||
if (props.maxDate && minCheckOut > props.maxDate) return true
|
||||
return false
|
||||
}
|
||||
if (y === start) return false
|
||||
if (y > start) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue