Calendar Blazor API

Calendar Properties

NameTypeDefaultDescription
AnimationSettingsobjectN/AApplies new animation settings when it is enabled.

Properties:
startSpeed - Determines the initial speed of the animation.
easeThreshold - Determines the point at which the animation starts to slow down - the "ease effect".
step - Determines the step ( scrolling interval ) at which the animation will run.
stepEaseSize - Coefficient that is used to calculated the new step once the threshold has been passed.
resetThreshold - Determines the threshold for animation reset. When it's reached the animation will start over.
CalendarModeCalendarModeCalendarMode.DefaultDetermines the date controls inside the header of the Calendar.
DayNameFormatDayFormatDayFormat.FirstTwoLettersDetermines the format of the day names located above the days inside the calendar.
DateFormatFunctionobjectN/A A callback that can be used to customize the format of the month name when calendarMode is set to 'default'.
DisabledboolfalseEnables or disables the Calendar.
DisableAutoNavigationboolfalseDisables auto navigation when the user clicks on a date that's not from the current month in view.
DisplayModeCalendarDisplayModeCalendarDisplayMode.MonthDetermines the date view of the calendar when calendarMode is set to 'default'
DisplayModeViewCalendarDisplayModeViewCalendarDisplayModeView.TableDetermines the type of the month/year view when calendarMode is set to Default.
DropDownHeightobject200Determines the height of the month's drop down inside the Calendar.
DropDownWidthobjectDetermines the width of the month's drop down inside the Calendar.
FirstDayOfWeekint0Determines the first day of the week. From 0(Sunday) to 6(Saturday)
FooterTemplateobjectN/ASets a custom footer template. Accepts the id of an HTMLTemplateElement or a reference ot it.
HeaderTemplateobjectN/ASets custom header template. Accepts the id of an HTMLTemplateElement or a reference ot it.
HideDayNamesboolfalseHides the names of the weekdays.
HideOtherMonthDaysboolfalseHides the dates from other months.
HideTooltipArrowboolfalseHides the arrow of the tooltip.
ImportantDatesIEnumerable<object>N/ASets the dates that will be displayed as important.
ImportantDatesTemplateobjectN/ASets a template for the important dates. Accepts the id of an HTMLTemplate element inside the DOM of or a reference to it.
Localestring"en" Determines the language of the Calendar.
Maxobjectnew Date(2100, 1, 1)Determines the max date for the Calendar. Accepts date objects and valid date string formats.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
Minobjectnew Date(1900, 1, 1)Determines the min date for the Calendar. Accepts date objects and valid date string formats.
Monthsint1Determines the number of months to be displayed inside the calendar. The maximum amount of months that can be shown is 12. By default only 1 month is shown.
MonthNameFormatMonthFormatMonthFormat.LongDetermines the format of the month names in the header when DisplayMode is set to Default or when Months property is greater than 1.
Namestring""Sets or gets the name attribute for the element. Name is used when submiting HTML forms.
ReadonlyboolfalseIf the element is readonly, users cannot interact with it.
RestrictedDatesIEnumerable<object>N/ASets restricted dates. Restricted dates are dates that cannot be selected/hovered/focused. They are visualy styled as restricted. The dates can be javascript date objects or strings representing a valid date.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
ScrollButtonsNavigationModeViewLayoutViewLayout.Landscape Determines the direction of the navigation buttons located in the header and the animation.
ScrollButtonsPositionLayoutPositionLayoutPosition.Both Determines the position of the navigation buttons located inside the header.
SelectedDatesIEnumerable<object>N/ASets the dates that will be selected. Selected dates are styled differently than the rest. The dates can be Date objects or strings in a valid date format.
SelectionModeCalendarSelectionModeCalendarSelectionMode.DefaultDetermines the date selection mode.
SpinButtonsDelayint80Sets the delay between clicks of the date navigation buttons located in the header of the Calendar.
SpinButtonsInitialDelayint0Determines the initial delay before the action of the date navigation buttons located in the header of the Calendar.
Themestring""Determines the theme. Theme defines the look of the element
TitleTemplateobjectN/ASets a template for the title section of the Calendar. Accepts the id of an HTMLTemplate element inside the DOM of or a reference it.
TooltipboolfalseEnables/Disabled the tooltip for the important dates. If enabled when an important date is hovered a tooltip is displayed.
TooltipArrowbooltrueShow/Hide the arrow of the the tooltip for the important dates. By default the arrow is visible.
TooltipDelayint100Sets the delay of the tooltip before it appears.
TooltipOffsetint[][]new Collection<int[][]>()Set's a custom offset to the tooltip's position. Accepts an array of two numbers: the left coordinate and the top coordinate.
TooltipPositionTooltipPositionTooltipPosition.TopSets the position of the tooltip.
TooltipTemplateobjectN/ASets a template for the tooltip's content. Accepts the id of an HTMLTEmplate element inside the DOM or it's reference.
UnfocusableboolfalseIf is set to true, the element cannot be focused.
ViewViewLayoutViewLayout.PortraitDetermines the orientation of the Calendar.
ViewSectionsstring[]new string[]{}Determines the visible sections of the Calendar. The view sections are : title, header, footer. Multiple sections can be applied at the same time. By default only the 'header' section is visible.
WeekNumbersboolfalseEnables/Disabled week numbering. If enabled week numbers are displayed infront of each week inside the Calendar.
Weeksint6Determines the number of visible weeks. The value of the property ranges from 1 to 6. Where 1 is one week and 6 is a full month ( 6 weeks ).
YearFormatYearFormatYearFormat.NumericDetermines the year format in the header when DisplayMode is set to Default or when Months property is greater than 1.

Calendar Methods

NameTypeArgumentsDescription
ClearSelectionvoidN/AClears the selection. Removes all seleceted dates.
GetSelectedDatesAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;SelectedDates&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
Navigateboolobject stepNavigates forwards/backwards depending on the argument.Args: object step - The argument can be the following: <ul><li> number - representing the number of months to scroll. Can be negavtive. If negative it will scroll backwards.</li><li> Date - a date object representing the Date to navigate to.</li><li> string - a string representing a valid Date, e.g. "2020-10-1" </li></ul>
Navigateboolint stepNavigates forwards/backwards depending on the argument.Args: int step - The argument can be the following: <ul><li> number - representing the number of months to scroll. Can be negavtive. If negative it will scroll backwards.</li><li> Date - a date object representing the Date to navigate to.</li><li> string - a string representing a valid Date, e.g. "2020-10-1" </li></ul>
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
Selectvoidobject dateSelects or Unselects a date.Args: object date - The date to be selected or unselected. The date can be a Date object or a string in valid date format.
Selectvoidstring dateSelects or Unselects a date.Args: string date - The date to be selected or unselected. The date can be a Date object or a string in valid date format.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
TodayDateTimeN/ASelects today's date.

Calendar Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered when a new date has been selected/unselected.IEnumerable<string> value- An array of all currently selected dates.
Changedevent CalendarChangedEventHandlerThis event is triggered when a new date has been selected/unselected.CalendarChangedEventArgs
OnDisplayModeChangingEventCallback<Event>This event is triggered when the displayMode is about to change. This event allows to cancel the operation by calling event.preventDefault() in the event handler function.dynamic oldDisplayMode- The previous display mode., dynamic newDisplayMode- The new display mode.
DisplayModeChangingevent CalendarDisplayModeChangingEventHandlerThis event is triggered when the displayMode is about to change. This event allows to cancel the operation by calling event.preventDefault() in the event handler function.CalendarDisplayModeChangingEventArgs
OnDisplayModeChangeEventCallback<Event>This event is triggered when the display mode has changed.N/A
DisplayModeChangedevent CalendarDisplayModeChangedEventHandlerThis event is triggered when the display mode has changed.CalendarDisplayModeChangedEventArgs
OnNavigationChangingEventCallback<Event>This event is triggered when the view is changing. This navigation can be cancelled by using the preventDefault method.DateTime value- The view's date., string type- The view type - 'month', 'decade' or 'year'.
NavigationChangingevent CalendarNavigationChangingEventHandlerThis event is triggered when the view is changing. This navigation can be cancelled by using the preventDefault method.CalendarNavigationChangingEventArgs
OnNavigationChangeEventCallback<Event>This event is triggered when the view is changed.DateTime value- The view's date., string type- The view type - 'month', 'decade' or 'year'.
NavigationChangedevent CalendarNavigationChangedEventHandlerThis event is triggered when the view is changed.CalendarNavigationChangedEventArgs
OnOpenEventCallback<Event>This event is triggered when the tooltip for the important date is opened.dynamic target- The event target - tooltip., dynamic value- The important date of the hovered cell.
Openedevent CalendarOpenedEventHandlerThis event is triggered when the tooltip for the important date is opened.CalendarOpenedEventArgs
OnCloseEventCallback<Event>This event is triggered when the tooltip for the important date is closed.dynamic target- The event target - tooltip., dynamic value- The important date of the hovered cell.
Closedevent CalendarClosedEventHandlerThis event is triggered when the tooltip for the important date is closed.CalendarClosedEventArgs

Enums

CalendarMode

CalendarMode.Default
CalendarMode.Classic

DayFormat

DayFormat.Narrow
DayFormat.FirstTwoLetters
DayFormat.Long
DayFormat.Short

CalendarDisplayMode

CalendarDisplayMode.Month
CalendarDisplayMode.Year
CalendarDisplayMode.Decade

CalendarDisplayModeView

CalendarDisplayModeView.Table
CalendarDisplayModeView.List

MonthFormat

MonthFormat.Narrow
MonthFormat.FirstTwoLetters
MonthFormat.Long
MonthFormat.Short
MonthFormat.TwoDigit
MonthFormat.Numeric

ViewLayout

ViewLayout.Landscape
ViewLayout.Portrait

LayoutPosition

LayoutPosition.Near
LayoutPosition.Far
LayoutPosition.Both

CalendarSelectionMode

CalendarSelectionMode.None
CalendarSelectionMode.Default
CalendarSelectionMode.Many
CalendarSelectionMode.One
CalendarSelectionMode.OneExtended
CalendarSelectionMode.OneOrMany
CalendarSelectionMode.Range
CalendarSelectionMode.Week
CalendarSelectionMode.ZeroOrMany
CalendarSelectionMode.ZeroOrOne

TooltipPosition

TooltipPosition.Auto
TooltipPosition.Absolute
TooltipPosition.Bottom
TooltipPosition.Top
TooltipPosition.Left
TooltipPosition.Right

YearFormat

YearFormat.TwoDigit
YearFormat.Numeric