Date & time
DatePickerControl · TimePickerControl · DateRangePickerControl · CalendarControl · TimeSpanPickerControlLet users type or pick a date, a time, a range or a duration.
Overview
DatePickerControl is a Blazor date picker: users type a date in any of sixteen formats or pick it from a calendar. Its siblings cover the rest of a booking: TimePickerControl lists times in steps, DateRangePickerControl takes a start and an end, CalendarControl can disable days such as weekends, and TimeSpanPickerControl takes a duration. All five bind two ways; the time and range pickers also report bad entries to a surrounding EditForm.
Examples
#Date, time and duration
Book an airport transfer: type a date or open the calendar, which only offers the days of the trip through MinDate and MaxDate. A typed date outside moves the bound date to the first or last day of the trip, though the box keeps the typed text. The time list runs 6:00 AM to 10:00 PM in half hours, and the line below follows every change.
Car for Albus Door, Lisbon airport to the old town: Sun Dec 13, 9:30 AM to 11:00 AM. The trip runs Dec 13 to Dec 17.
#Date range
Pick a check-in and a check-out, or press a preset, which calls SetValueAsync: one CalendarRange binds both boxes and the popup, and DisabledDate blocks the sold-out dates. The popup refuses a range that includes one; typed dates still reach the page with an Error, so the quote checks it first.
Amalfi hotel for Albus Door: 3 nights, Sun Dec 20 to Wed Dec 23, $540 at $180 a night. Dec 14 to Dec 16 is sold out.
#Calendar, several dates
Click the departures a group could take: each day shows its price through DayTemplate, Mondays are disabled, and the heading switches to year and decade views.
2 departures: Tue Dec 8 ($80), Thu Dec 10 ($80). Cheapest: $80.