Skip to content

Pickers

DateRangePicker

Bit.BlazorUIDateTimeRangePicker

A BitDateRangePicker is a drop-down calendar for picking a start and an end date, where context such as the day of the week matters. It offers one-click presets, up to three months side by side, range limits and disabled days, an optional time picker, an optional Apply/Cancel step, an inline mode, full keyboard support and any culture or time zone.

Culture, modes & templates

Cultures and time zones, a standalone calendar, read-only pickers, templates and responsive layouts.

Culture

Culture (the current UI culture by default) drives the calendar system, month and day names, first day of the week, AM/PM designators and text direction. See CultureInfoHelper (opens in a new tab) for building a custom one.

The culture's DateTimeFormat.Calendar lays out the grids, so a fa-IR picker shows Persian months and years, counts its week numbers in them and navigates by them, while the value stays an ordinary DateTimeOffset. The culture also gives the default DateFormat (its short date and time patterns), reads typed text back, and supplies the first day of the week unless FirstDayOfWeek overrides it. A right-to-left culture lays the picker out right to left without a Dir.

The culture does not translate the picker's own words: the button titles, the aria labels, ValueFormat, ApplyButtonText and the rest are parameters, written in the page's language, as the GoToTodayTitle and ValueFormat of these pickers are. A BitParams can hand them to every picker at once (see Cascading parameters).



TimeZone

TimeZone is the zone the dates are shown and produced in, instead of the local one. Time-zone data depends on the OS and on settings such as InvariantTimezone (more info(opens in a new tab)).

A picked day becomes a DateTimeOffset carrying that zone's offset for that date (daylight saving included). A value handed in with any other offset is read in that zone - by the calendar, the field and the month the calendar opens on alike - so the same instant may sit on a different day there than in the offset it carries. Today, MinDate/MaxDate, DisabledDates, HighlightedDates and the times of the time picker are all read in that zone too.

The default is TimeZoneInfo.Local: the browser's zone under WebAssembly, but the server's zone under Blazor Server and during prerendering. When the user's zone matters, pass it explicitly.

Default (local TimeZone):


Selected date range: from - to -




"Dateline Standard Time" TimeZone:


Selected date range: from - to -

Standalone

Standalone renders the calendar inline, without the field and callout - for filter panels and dashboards. Everything else behaves as in the drop-down.

What belongs to the callout does nothing there: IsOpen, OpenCallout/CloseCallout, AutoClose, AutoApply (every pick applies at once, no Apply/Cancel buttons), ShowCloseButton, Responsive, DropDirection and AutoFocus. The Label still renders above the calendar, the value is still carried by a hidden input named by Name for a form post, and an ErrorMessage goes under the calendar. The calendar is a group of controls in the page rather than a dialog: nothing traps the focus, and Tab moves into and out of it like any other control. MonthCount, Presets and ShowTimePicker make it wider, so give it the room.
November 2026
S
M
T
W
T
F
S


November 2026
S
M
T
W
T
F
S


November 2026
#
S
M
T
W
T
F
S
44
45
46
47
48


November 2026
S
M
T
W
T
F
S


S
M
T
W
T
F
S
:
:

ReadOnly

ReadOnly keeps the calendar opening and browsable but blocks every change: the days, presets and time spinners stop reacting to the pointer, typed text is ignored and the clear button is hidden. Unlike Disabled, the value is still submitted with the form.

Use it to show a range the user may look at but not change - a booking already confirmed, a field locked by a workflow step. The field stays focusable and in the tab order, the days announce themselves with aria-readonly, no range preview follows the pointer, the Apply button of an AutoApply="false" picker is disabled, and the time fields are read-only. Month and year navigation still work, so the user can browse to the range. The value can still be changed from code.




Selected date range Start: 12/8/2024 - End: 12/12/2024
December 2024
S
M
T
W
T
F
S


Selected date range Start: 12/8/2024 12:15 - End: 12/12/2024 16:45
S
M
T
W
T
F
S
:
:

Templates

LabelTemplate and IconTemplate replace the label and the field's icon; DayCellTemplate, MonthCellTemplate and YearCellTemplate render a calendar cell from its date (or year); CalloutHeaderTemplate and CalloutFooterTemplate frame the callout.
  • LabelTemplate wins over Label and is still the field's <label>, but the asterisk of Required only follows a plain Label. IconTemplate wins over Icon/IconName.
  • A cell template only replaces what is drawn inside the cell's button: the picker still handles the click, the keyboard, the disabled, selected and today states and the accessible name (the full date or month name). DayCellTemplate and MonthCellTemplate receive a DateTimeOffset - the day, or the first day of the month, at midnight in the picker's TimeZone - and YearCellTemplate the year as an int, counted in the Culture's calendar. The DateTimeOffset itself is Gregorian, so under a culture with another calendar read its day and month through culture.DateTimeFormat.Calendar. Keep the content small: the cells are fixed-size.
  • The header and footer templates sit above and below everything else in the callout (the footer above the Apply/Cancel buttons) - a place for a hint, a legend or buttons of your own that set the value from code.












Responsive

Responsive turns the callout into a full-width, swipe-to-dismiss panel with touch-sized cells on small screens.

Below the small-screen breakpoint the callout slides down from the top edge of the screen instead of opening next to the field, clear of a notch or status bar, and swiping it back up closes it - a close like any other, which rolls back an Apply/Cancel picker. On wider screens the picker opens as usual. It has no effect on a Standalone picker. Independently of it, a callout too narrow for its content already folds the month picker and the time picker behind toggles and drops extra months.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.