Compare commits
No commits in common. "fa7436a499a7e3c8e2f4dd619686ac5d701f0edb" and "42d7eaaaddcac92e78ee59f9a01bad20fcb2f3eb" have entirely different histories.
fa7436a499
...
42d7eaaadd
1 changed files with 2 additions and 13 deletions
|
|
@ -106,19 +106,8 @@ function isDateDisabled(d: DateValue): boolean {
|
||||||
if (y < todayYmd) return true
|
if (y < todayYmd) return true
|
||||||
const start = activeStart.value
|
const start = activeStart.value
|
||||||
if (!start) {
|
if (!start) {
|
||||||
// Picking a check-in. An occupied night is out — except a committed
|
// Picking a check-in: occupied nights are out; everything else is fair.
|
||||||
// check-out that landed on one, which must stay rendered as selected.
|
return props.nightSet.has(y) && !(bothSet.value && y === props.checkOut)
|
||||||
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) return false
|
||||||
if (y > start) {
|
if (y > start) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue