function isBookingRangeValid
isBookingRangeValid(
listing: Listing,
date: string,
days: number,
holidays: Holiday[],
): boolean

Whether booking days consecutive days starting on date is valid for a daily listing: every day must be a bookable weekday, fall outside all holidays, and stay within the listing's booking window. Used to enforce the visitor's chosen span on "customisable days" listings at submit time, where the day count isn't known when the date list is rendered.

Parameters

listing: Listing
date: string
days: number
holidays: Holiday[]

Return Type

boolean

Usage

import { isBookingRangeValid } from "doc.ts";