Blazor Toolkit Calendar Component
The Blazor Calendar component provides an intuitive interface for date selection and navigation. It offers a comprehensive set of features including multiple view modes, multi-selection, week number and accessibility support for building robust date-picking experiences.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
Year And Decade Views
The Calendar component supports multiple view modes including month, year, and decade views. Users can switch between different views using the Start and Depth properties to control the initial view and navigation depth.
| Jan | Feb | Mar | Apr |
| May | Jun | Jul | Aug |
| Sep | Oct | Nov | Dec |
| 2019 | 2020 | 2021 | 2022 |
| 2023 | 2024 | 2025 | 2026 |
| 2027 | 2028 | 2029 | 2030 |
Date Range
The Min and Max properties used to control date selection by setting minimum and maximum selectable dates. This ensures users can only select dates within the specified range, making it ideal for booking systems and date-restricted scenarios.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
Multi Selection
The IsMultiSelection property enable users to select multiple non-consecutive dates. This is useful for scheduling events, selecting date ranges, or marking multiple important dates.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
Special Dates
Customize specific dates in a Blazor Calendar by handling the DayCellRendering event. This event fires for each day cell as it is created, allowing the addition of CSS classes and, if needed, disabling particular dates. The following example highlights two sets of days in the current month with custom styles using the personal-appointment and official-appointment classes, and updates a label on selection via ValueChange event.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
Islamic Calendar
The Blazor Calendar component supports displaying the Islamic (Hijri) Calendar. The Hijri Calendar is a lunar Calendar with 12 months and 354 or 355 days per year. To render the Islamic Calendar, set the CalendarMode property to CalendarType.Islamic. This switches the Calendar system used for display and selection.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 30 | 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 1 | 2 | 3 | 4 | 5 |
Week Number
The WeekNumber property is used to display week numbers alongside the Calendar dates. This feature is particularly useful for business applications that reference ISO week numbers for planning and reporting purposes. Configure how the first week of the year is determined by using the WeekRule property (aligned with .NET CalendarWeekRule semantics).
| S | M | T | W | T | F | S | |
|---|---|---|---|---|---|---|---|
| 18 | 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 19 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 20 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 21 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 23 | 31 | 1 | 2 | 3 | 4 | 5 | 6 |
First Day Of Week
The Calendar provides an option to change the first day of the week by using the FirstDayOfWeek property. Generally, the day of the week starts from 0 (Sunday) and ends with 6 (Saturday).
| T | W | T | F | S | S | M | |
|---|---|---|---|---|---|---|---|
| 18 | 28 | 29 | 30 | 1 | 2 | 3 | 4 |
| 19 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 20 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 21 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 22 | 26 | 27 | 28 | 29 | 30 | 31 | 1 |