Calendar
Container for displaying data in calendar form.
When To Use
When data is in the form of dates, such as schedules, timetables, prices calendar, lunar calendar. This component also supports Year/Month switch.
Examples
Calendar API#
| Property | Description | Type | Default Value |
|---|---|---|---|
| Value | ParameterSelected value for calendar | DateTime | DateTime.Now |
| DefaultValue | ParameterDefault value for selected date. When set, will set AntDesign.Calendar.Value |
DateTime | -- |
| ValidRange | ParameterValidate range of dates or selection | DateTime[] | -- |
| Mode | ParameterDisplay mode. See CalendarMode for valid options |
CalendarMode | CalendarMode.Month |
| FullScreen | ParameterWhether the calendar should take up all available space or not | Boolean | true |
| OnSelect | ParameterCallback executed when a date is selectedUse OnChange instead Obsolete Will be removed in a future version. |
EventCallback<DateTime> | -- |
| OnChange | ParameterCallback executed when a date is selected | EventCallback<DateTime> | -- |
| HeaderRender | ParameterFunction to render a custom header | Func<CalendarHeaderRenderArgs, RenderFragment> | -- |
| DateCellRender | ParameterCustomize the display of the date cell, the returned content will be appended to the cell | Func<DateTime, RenderFragment> | -- |
| DateFullCellRender | ParameterCustomize the display of the date cell, the returned content will override the cell | Func<DateTime, RenderFragment> | -- |
| MonthCellRender | ParameterCustomize the display of the month cell, the returned content will be appended to the cell | Func<DateTime, RenderFragment> | -- |
| MonthFullCellRender | ParameterCustomize the display of the month cell, the returned content will override the cell | Func<DateTime, RenderFragment> | -- |
| OnPanelChange | ParameterCallback executed when the type of calendar being viewed changes | Action<DateTime, DatePickerType> | -- |
| DisabledDate | ParameterFunction to determine if a specific date is disabled | Func<DateTime, Boolean> | -- |
| Locale | ParameterLocale information for UI and date formatting | DatePickerLocale | -- |
| CultureInfo | ParameterCulture information used for formatting | CultureInfo | -- |
| DateCalendar | Parameter.NET calendar used for date selection and panel navigation. When omitted, the calendar of AntDesign.Calendar.CultureInfo is used. |
Calendar | -- |
| AdditionalAttributes | ParameterAdditional HTML attributes for the component's DOM target. See the arbitrary attributes documentation for composite components and attribute precedence. | IReadOnlyDictionary<String, Object> | -- |
| Class | ParameterSpecifies one or more class names for an DOM element. | String | -- |
| Style | ParameterSpecifies an inline style for a DOM element. | String | -- |
| Id | ParameterID for the component's HTML and its component props override entry. | String | -- |
| RefBack | ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. |
ForwardRef | -- |
| Method Signature | Return Type | Description |
|---|---|---|
| ChangePickerType(DatePickerType type, Int32 index) | void | |
| ChangePickerType(DatePickerType type) | void |