Skip to content

Pickers

DatePicker

Bit.BlazorUIMonthPickerYearPickerDateTimePicker

A BitDatePicker picks a date, or a date and time, from a drop-down or inline calendar with day, month and year views. It supports min/max, disabled and highlighted dates, typed input, any culture, calendar and time zone, and the WAI-ARIA combobox and grid keyboard patterns.

Calendar & time

The day grid (week start, week numbers, several months), the month and year pickers, and the time picker with its steps and bounds.

Calendar layout

FirstDayOfWeek, WeekNumberRule (ISO 8601: FirstFourDayWeek from Monday), ShowOutsideDays and FixedWeeks shape the day grid. MonthCount shows up to three months side by side (fewer on a narrow viewport) and PagedNavigation moves them all at once.
  • FirstDayOfWeek (default: the Culture's) also starts the week that Home/End move within and that the week numbers count.
  • WeekNumberRule defaults to CalendarWeekRule.FirstFullWeek; ISO 8601 weeks need FirstFourDayWeek together with a Monday start, as the second picker sets.
  • ShowOutsideDays (default true) fills the first and last week with the days of the adjacent months; FixedWeeks always draws six weeks so the height never changes between months.
  • MonthCount is clamped to 1 - 3. A strip of months always draws six weeks and never the outside days, so FixedWeeks and ShowOutsideDays do nothing there. The arrow keys and the selection run across the months, and picking a day in a month already on screen leaves the strip where it is. A picker with a callout shows fewer months when the viewport cannot hold them; a Standalone one always shows what it is asked for.
  • PagedNavigation makes the previous/next buttons move by the whole strip instead of one month; with a single month it changes nothing.











Month & year pickers

Hide the month/year picker with ShowMonthPicker, or open it over the day picker from the month title with ShowMonthPickerAsOverlay - which a narrow screen turns on by itself.

By default the month picker sits beside the day grid; its title switches it to a year picker that pages through twelve years at a time. Picking a month there only moves the day grid to it - a day still has to be picked. ShowMonthPicker="false" removes the pane, which leaves the previous/next month buttons as the way to move around. With ShowMonthPickerAsOverlay the pane is hidden until the month title of the day grid is clicked, and closes again once a month is picked. The callout decides each time it opens whether it is wide enough for the pane beside the grid, and falls back to the overlay when it is not. Beside a time picker the time takes that place, so the month picker is opened over the day grid from the title in the same way. Neither parameter applies to the MonthPicker and YearPicker modes of the Mode section, where the month or year grid is the only view.






TimePicker

ShowTimePicker adds the time of day, ShowSeconds a seconds field, TimeFormat the 12-hour clock, ShowTimePickerAsOverlay puts it behind a clock button, and ShowNowButton hides the now button. Selecting a day keeps the callout open so the time can be set too.

The offered times: HourStep/MinuteStep/SecondStep set the grid, MinTime/MaxTime bound every day (MinDate/MaxDate only bound the day they fall on), and AllowedHours/AllowedMinutes/AllowedSeconds rule out the rest. The spin buttons, the PageUp/PageDown keys and typing all obey them. ContinuousSpinDelay and ContinuousSpinInterval tune press-and-hold.

How the time and the value meet:
  • The time edits the selected day. While the picker is empty the time is only held, and the next picked day takes it. The now button is the exception: on an empty picker it picks today along with the current time (unless today is disabled).
  • A step grid starts at MinTime (at midnight, or at the top of the hour/minute, without one), so MinuteStep="15" with a MinTime of 09:10 offers :10, :25, :40 and :55. Steps below 1 count as 1. A typed hour or minute snaps to the nearest allowed value when the field is committed.
  • MinTime/MaxTime are clamped into a day (00:00:00 - 23:59:59). On the day MinDate/MaxDate falls on, the narrower of the two bounds wins.
  • AllowedHours receives 0 - 23 whatever the TimeFormat. SecondStep and AllowedSeconds only matter with ShowSeconds; without it the value has no seconds.
  • On the 12-hour clock a typed hour keeps the AM/PM already selected.
  • The default format of the field adds the time (and the seconds) in the chosen clock format. The time picker is only offered in the DatePicker Mode.

Selected DateTime:
















Feedback

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