menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CalendarBase<T> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CalendarBase<T>

    The Calendar is a graphical user interface component that displays a Gregorian Calendar, and allows a user to select a date.

    Inheritance
    System.Object
    SfBaseComponent
    SfInputTextBase<T>
    CalendarBase<T>
    SfCalendar<TValue>
    SfDatePicker<TValue>
    SfDateRangePicker<TValue>
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    SfInputTextBase<T>._value
    SfInputTextBase<T>.APPEND
    SfInputTextBase<T>.APPEND_ICON
    SfInputTextBase<T>.ARIA_DISABLED
    SfInputTextBase<T>.BaseAutocomplete
    SfInputTextBase<T>.BaseFloatLabelType
    SfInputTextBase<T>.BaseHtmlAttributes
    SfInputTextBase<T>.BaseInputAttributes
    SfInputTextBase<T>.BaseIsReadOnlyInput
    SfInputTextBase<T>.BasePlaceholder
    SfInputTextBase<T>.BaseReadonly
    SfInputTextBase<T>.BaseShowClearButton
    SfInputTextBase<T>.BaseTabIndex
    SfInputTextBase<T>.BaseWidth
    SfInputTextBase<T>.ChangeHandler(ChangeEventArgs)
    SfInputTextBase<T>.CLEAR_ICON_HIDE
    SfInputTextBase<T>.ClearElement
    SfInputTextBase<T>.CLEARICONHIDE
    SfInputTextBase<T>.ComponentReference
    SfInputTextBase<T>.ContainerAttr
    SfInputTextBase<T>.containerAttributes
    SfInputTextBase<T>.CONTROL_CONTAINER
    SfInputTextBase<T>.CONTROL_OLD_CONTAINER
    SfInputTextBase<T>.CssClass
    SfInputTextBase<T>.DataId
    SfInputTextBase<T>.DECREMENT
    SfInputTextBase<T>.DECREMENT_TITLE
    SfInputTextBase<T>.DecrementTitle
    SfInputTextBase<T>.DISABLE
    SfInputTextBase<T>.DISABLE_ICON
    SfInputTextBase<T>.DISABLED_ATTR
    SfInputTextBase<T>.Enabled
    SfInputTextBase<T>.EnablePersistence
    SfInputTextBase<T>.EnableRtl
    SfInputTextBase<T>.FLOATINPUT
    SfInputTextBase<T>.FloatLabel
    SfInputTextBase<T>.FLOATLABELBOTTOM
    SfInputTextBase<T>.FLOATLABELTOP
    SfInputTextBase<T>.FLOATTEXT
    SfInputTextBase<T>.FocusHandler(FocusEventArgs)
    SfInputTextBase<T>.FocusOutHandler(FocusEventArgs)
    SfInputTextBase<T>.FormatValue(String)
    SfInputTextBase<T>.FormatValueAsString(T)
    SfInputTextBase<T>.GROUP_ICON
    SfInputTextBase<T>.ID
    SfInputTextBase<T>.INCREMENT
    SfInputTextBase<T>.INCREMENT_TITLE
    SfInputTextBase<T>.IncrementTitle
    SfInputTextBase<T>.INPUT
    SfInputTextBase<T>.inputAttr
    SfInputTextBase<T>.InputEditContext
    SfInputTextBase<T>.INPUTFOCUS
    SfInputTextBase<T>.INPUTGROUP
    SfInputTextBase<T>.InputHandler(ChangeEventArgs)
    SfInputTextBase<T>.IsClearButtonClicked
    SfInputTextBase<T>.IsFocused
    SfInputTextBase<T>.ListOfButtons
    SfInputTextBase<T>.MULTILINE
    SfInputTextBase<T>.MultilineInput
    SfInputTextBase<T>.OnAfterRenderAsync(Boolean)
    SfInputTextBase<T>.OnChangeHandler(ChangeEventArgs)
    SfInputTextBase<T>.OnInitializedAsync()
    SfInputTextBase<T>.OnInputHandler(ChangeEventArgs)
    SfInputTextBase<T>.OnParametersSetAsync()
    SfInputTextBase<T>.OnPasteHandler(ClipboardEventArgs)
    SfInputTextBase<T>.PREPEND
    SfInputTextBase<T>.PREPEND_ICON
    SfInputTextBase<T>.SetEnabled()
    SfInputTextBase<T>.SPACE
    SfInputTextBase<T>.SPIN_DOWN
    SfInputTextBase<T>.SPIN_UP
    SfInputTextBase<T>.ValidateOnInput
    SfInputTextBase<T>.Value
    SfInputTextBase<T>.ValueChanged
    SfInputTextBase<T>.WireClearBtnEvents()
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.BlurHandler(System.String, System.Boolean)
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.ClickStopPropagation
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.ContainerClass
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.IsValueTemplate
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.MouseDowSpinnerPrevent
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.MousePreventContainer
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.OnBlur
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.OnChange
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.OnFocus
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.OnInput
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.OnPaste
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.PreventIconHandler
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.RootClass
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.SpinButton
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.ValueExpression
    Syncfusion.Blazor.Inputs.SfInputTextBase<T>.ValueTemplate
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class CalendarBase<T> : SfInputTextBase<T>
    Type Parameters
    Name Description
    T

    Specifies the type of CalendarBase.

    Constructors

    CalendarBase()

    Declaration
    public CalendarBase()

    Properties

    CalendarEditContext

    Specifies the editcontext of the Calendar.

    Declaration
    protected EditContext CalendarEditContext { get; set; }
    Property Value
    Type
    Microsoft.AspNetCore.Components.Forms.EditContext

    CalendarMode

    Sets the calendar's type like Gregorian.

    Declaration
    public CalendarType CalendarMode { get; set; }
    Property Value
    Type
    CalendarType

    DayHeaderFormat

    Specifies the format of the day that to be displayed in the header. By default, the format is short.

    Possible formats are:

    • ShortSets the short format of day name (like Su ) in day header.
    • NarrowSets the single character of day name (like S ) in day header.
    • AbbreviatedSets the min format of day name (like Sun ) in day header.
    • WideSets the long format of day name (like Sunday ) in day header.
    Declaration
    public DayHeaderFormats DayHeaderFormat { get; set; }
    Property Value
    Type
    DayHeaderFormats

    Depth

    Sets the maximum level of views such as a month, year, and decade in the calendar.

    The depth view should be smaller than the start view to restrict its view navigation.

    Declaration
    public CalendarView Depth { get; set; }
    Property Value
    Type
    CalendarView

    FirstDayOfWeek

    Sets the calendar's first day of the week. By default, the first day of the week will be based on the current culture.

    Declaration
    public int FirstDayOfWeek { get; set; }
    Property Value
    Type
    System.Int32

    KeyConfigs

    Customizes the key actions in the calendar.

    For example, when using a German keyboard, the key actions can be customized using these shortcuts.

    Declaration
    public Dictionary<string, object> KeyConfigs { get; set; }
    Property Value
    Type
    System.Collections.Generic.Dictionary<System.String, System.Object>

    Max

    Gets or sets the maximum allowable date or time value.

    Declaration
    public virtual DateTime Max { get; set; }
    Property Value
    Type
    System.DateTime

    Min

    Specifies a minimum date that is allowed a user can select in the calendar.

    Declaration
    public virtual DateTime Min { get; set; }
    Property Value
    Type
    System.DateTime

    ServerTimezoneOffset

    By default, the date value will be processed based on the system time zone.

    If you want to process the initial date value using the server time zone then specify the time zone value to the ServerTimezoneOffset property.

    Declaration
    public double ServerTimezoneOffset { get; set; }
    Property Value
    Type
    System.Double

    ShowTodayButton

    Specifies whether the today button will be displayed in the calendar.

    Declaration
    public bool ShowTodayButton { get; set; }
    Property Value
    Type
    System.Boolean

    Start

    Specifies the initial view of the calendar when it is opened. With the help of this property, the initial view can be changed to the year or decade view.

    Declaration
    public CalendarView Start { get; set; }
    Property Value
    Type
    CalendarView

    WeekNumber

    Specifies whether the week number of the year will be displayed in the calendar.

    Declaration
    public bool WeekNumber { get; set; }
    Property Value
    Type
    System.Boolean

    WeekRule

    Specifies the rule for defining the first week of the year.

    Declaration
    public CalendarWeekRule WeekRule { get; set; }
    Property Value
    Type
    System.Globalization.CalendarWeekRule

    Methods

    ChangeEvent(EventArgs, Boolean)

    Triggers when the value get changed.

    Declaration
    protected virtual void ChangeEvent(EventArgs args, bool isSelection = false)
    Parameters
    Type Name Description
    System.EventArgs args

    Specifies the System.EventArgs.

    System.Boolean isSelection

    Determines whether selection is made using the mouse or keyboard.

    ConvertDateValue(T)

    Declaration
    protected DateTime ConvertDateValue(T dateValue)
    Parameters
    Type Name Description
    T dateValue
    Returns
    Type
    System.DateTime

    ConvertToGregorian(String, String)

    Converts a formatted Hijri date string to a Gregorian System.DateTime object.

    Declaration
    public T ConvertToGregorian(string hijriDate, string format)
    Parameters
    Type Name Description
    System.String hijriDate

    The Hijri date string to convert, formatted according to the specified format.

    System.String format

    The format string that specifies the structure of the hijriDate. Valid format components include "dd" for day, "MM" for month (numeric), "MMM"/"MMMM" for month name, "yyyy" for year, and "HH"/"mm"/"ss" for time.

    Returns
    Type Description
    T

    A System.DateTime object in Gregorian format representing the date and time specified in the Hijri hijriDate.

    Remarks

    This method splits the hijriDate and format into individual components, parses each component to extract day, month, year, and time values, and converts them from Hijri to Gregorian. It assumes that the hijriDate is in the Hijri calendar.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when hijriDate or format is null or empty.

    ConvertToHijri(T, String)

    Converts a Gregorian System.DateTime object to a formatted Hijri date string.

    Declaration
    public string ConvertToHijri(T gregorianDate, string format)
    Parameters
    Type Name Description
    T gregorianDate

    The Gregorian date to be converted to Hijri, of type T.

    System.String format

    The format string specifying the output structure of the Hijri date. Supports standard date format specifiers such as "dd", "MM", "MMM", "MMMM", "yyyy", and time components.

    Returns
    Type Description
    System.String

    A string representing the Hijri date formatted according to the specified format.

    Remarks

    This method converts a System.DateTime value from Gregorian to Hijri and formats it. If the format string contains "MMM" or "MMMM", it replaces the month part with a Hijri month name (abbreviated or full, depending on the format).

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when format is null.

    GetDefaultFormat()

    Declaration
    protected string GetDefaultFormat()
    Returns
    Type
    System.String

    GetHijriMonthIndex(String, String)

    Declaration
    protected int GetHijriMonthIndex(string monthName, string format)
    Parameters
    Type Name Description
    System.String monthName
    System.String format
    Returns
    Type
    System.Int32

    ReplaceMonthName(String, DateTime, String[], String)

    Declaration
    protected static string ReplaceMonthName(string formattedDate, DateTime finalDate, string[] hijriMonths, string format)
    Parameters
    Type Name Description
    System.String formattedDate
    System.DateTime finalDate
    System.String[] hijriMonths
    System.String format
    Returns
    Type
    System.String
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved