Inputs
Calendar
BitCalendar is a fully-featured inline calendar for browsing and selecting a single date, or a date and time when the built-in time picker is enabled. It offers day, month and year grids, day events with details, and flexible day/week rules such as disabled and highlighted dates, a custom first day of week and week numbers. It works with any culture and time zone, including right-to-left and non-Gregorian calendars, and every grid follows the WAI-ARIA grid pattern for the keyboard.
Layout & styling
Several months side by side, shared defaults through BitParams, colors, icons, sizes, Style & Class with the CSS variables, and right-to-left calendars.
Multiple months
- MonthCount defaults to 1 and is clamped to 1 - 3.
- The strip reads as one calendar: only the first month has the back arrow (and, where the month picker is an overlay, the title that opens it), and only the last one has the forward arrow.
- Picking a day of the second or third month does not page the view, and neither does a value set from code that is already on screen. OnMonthChange reports the first month of the strip.
- PagedNavigation has no effect with a single month, and stops where a single step would have stopped at MinDate / MaxDate.
Cascading parameters
Its members are the component's parameters as nullable properties, where
null means
"not set by the cascade". A value from the cascade counts as set on the calendar: a cascaded
Color or Size wins over the CSS variables just as one written on the calendar would.
Parameters takes a list of params objects, so one BitParams can carry the defaults of
several kinds of component; a nested one adds to what its ancestors carry, unless it is
Isolated.
Color
Left unset (the default) the calendar is primary, and the
--bit-Calendar-* today, focus
and event variables can restyle it; a Color that is set wins over them. An event's own
Color wins over the calendar's for its dot and its row in the details dialog. The
*Background colors are close to the page's own background, so they are shown on a
contrasting surface below.
External Icons
- The icons: GoToToday, PrevMonthNav / NextMonthNav (day grid), PrevYearNav / NextYearNav (month grid), PrevYearRangeNav / NextYearRangeNav (year grid), ShowTimePicker / HideTimePicker (the overlay time picker's toggles), NowButton, and TimePickerIncreaseHour / TimePickerDecreaseHour / TimePickerIncreaseMinute / TimePickerDecreaseMinute.
- The calendar does not load an external library: add its stylesheet to the page yourself, as
this section does with a
<link>. - An icon only changes what a button shows; its name and tooltip still come from the matching *Title parameter.
Size
Left unset (the default) the calendar is medium, and
--bit-Calendar-day-size /
--bit-Calendar-day-font-size can resize it; a Size that is set wins over them.
For a size between the three, leave Size unset and use the variables (see the
Style & Class section).
Style & Class
- A day has a part for every state - SelectedDayButton, TodayDayButton, HighlightedDayButton - added on top of DayButton. In Styles, the DayButton style comes last on every day, so it wins over a state's style for the same property.
- The event dialog has its own parts (EventModalOverlay, EventItem, EventItemTitle, ...), and the header and footer templates are wrapped in Header and Footer.
- A class from a scoped
.razor.cssstylesheet reaches these parts only through::deep, from a plain element of your own around the calendar.
:root or any ancestor re-skins every calendar below
it, and one on the Style of an instance re-skins that one and any calendar nested in it. They restyle
the default, not a choice: an explicit Color or Size wins over the variables for what it sets.
RTL
Left unset, Dir follows the direction of the page around the calendar (or of its culture, as above), and
BitDir.Auto takes the direction of its content. An explicit Dir wins
over the culture, so BitDir.Ltr keeps a Persian calendar left to right. Only the
horizontal arrows are mirrored: the up and down arrows and the page keys mean the same in both
directions.
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.