Skip to content

Date Range Picker

A start and an end date, each typed into its own segments, with a button that opens a range calendar in a popover.

Styled with CSS Tailwind

Date range picker

Two BitBhDateRangePickerInputs — the start and the end, each a date field named "Start date" / "End date" and the field's label — the trigger and a range calendar in the popover. The focus runs on from the start's year into the end's month, so a whole range types in one go. The group gets data-[focused]: while either date has the focus and data-state-open: while the calendar is open; the calendar's cells take data-selection-start:, data-selection-end: and data-range-middle:.

mmddyyyy
mmddyyyy

Stay: none

Limits and unavailable dates

Min, Max and IsDateUnavailable reach the calendar, and a range can't span a booked night; a typed range that breaks them, or an end before its start, marks the picker invalid (data-[invalid]:).

mmddyyyy
mmddyyyy

The next six months; struck-through nights are booked.

Booking: none

In a German form

@bind-Value joins EditForm validation, Name posts an ISO interval, and the inputs and the button take German names; with a German Culture the segments read dd.MM.yyyy.

ddmmyyyy
ddmmyyyy
An unhandled error has occurred. Reload 🗙