menu

Blazor

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

    Show / Hide Table of Contents

    Class SfDateTimePicker<TValue>

    The DateTimePicker is a graphical user interface component that allows the user to select or enter a date and time value.

    Inheritance
    System.Object
    SfBaseComponent
    SfInputTextBase<TValue>
    CalendarBase<TValue>
    SfDatePicker<TValue>
    SfDateTimePicker<TValue>
    Inherited Members
    CalendarBase<TValue>.CalendarEditContext
    CalendarBase<TValue>.CalendarMode
    CalendarBase<TValue>.ConvertDateValue(TValue)
    CalendarBase<TValue>.ConvertToGregorian(String, String)
    CalendarBase<TValue>.ConvertToHijri(TValue, String)
    CalendarBase<TValue>.DayHeaderFormat
    CalendarBase<TValue>.Depth
    CalendarBase<TValue>.FirstDayOfWeek
    CalendarBase<TValue>.GetHijriMonthIndex(String, String)
    CalendarBase<TValue>.KeyConfigs
    CalendarBase<TValue>.ReplaceMonthName(String, DateTime, String[], String)
    CalendarBase<TValue>.ServerTimezoneOffset
    CalendarBase<TValue>.ShowTodayButton
    CalendarBase<TValue>.Start
    CalendarBase<TValue>.WeekNumber
    CalendarBase<TValue>.WeekRule
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfDatePicker<TValue>.AllowEdit
    SfDatePicker<TValue>.ARIA_ACTIVE_DESCENDANT
    SfDatePicker<TValue>.ARIA_INVALID
    SfDatePicker<TValue>.BaseFloatLabelType
    SfDatePicker<TValue>.BaseHtmlAttributes
    SfDatePicker<TValue>.BaseInputAttributes
    SfDatePicker<TValue>.BaseIsReadOnlyInput
    SfDatePicker<TValue>.BasePlaceholder
    SfDatePicker<TValue>.BaseReadonly
    SfDatePicker<TValue>.BaseShowClearButton
    SfDatePicker<TValue>.BaseTabIndex
    SfDatePicker<TValue>.BaseWidth
    SfDatePicker<TValue>.ClientPopupRender()
    SfDatePicker<TValue>.CreateMask()
    SfDatePicker<TValue>.CurrentView()
    SfDatePicker<TValue>.DATE_ICON
    SfDatePicker<TValue>.EnableMask
    SfDatePicker<TValue>.ERROR_CLASS
    SfDatePicker<TValue>.FALSE
    SfDatePicker<TValue>.FloatLabelType
    SfDatePicker<TValue>.FocusAsync()
    SfDatePicker<TValue>.FocusOutAsync()
    SfDatePicker<TValue>.Format
    SfDatePicker<TValue>.FormatValue(String)
    SfDatePicker<TValue>.FormatValueAsString(TValue)
    SfDatePicker<TValue>.FullScreen
    SfDatePicker<TValue>.GetDefaultFormat()
    SfDatePicker<TValue>.GetPersistDataAsync()
    SfDatePicker<TValue>.HidePopupAsync(EventArgs)
    SfDatePicker<TValue>.HtmlAttributes
    SfDatePicker<TValue>.InputAttributes
    SfDatePicker<TValue>.InputFormats
    SfDatePicker<TValue>.InputHandler(ChangeEventArgs)
    SfDatePicker<TValue>.InvokeClearBtnEvent(EventArgs)
    SfDatePicker<TValue>.NavigateAsync(CalendarView, TValue)
    SfDatePicker<TValue>.OpenOnFocus
    SfDatePicker<TValue>.Placeholder
    SfDatePicker<TValue>.Readonly
    SfDatePicker<TValue>.ShowClearButton
    SfDatePicker<TValue>.ShowPopup(EventArgs)
    SfDatePicker<TValue>.ShowPopupAsync(EventArgs)
    SfDatePicker<TValue>.StrictMode
    SfDatePicker<TValue>.TabIndex
    SfDatePicker<TValue>.TimePart
    SfDatePicker<TValue>.UpdateDateTimePopupState(Boolean)
    SfDatePicker<TValue>.UpdateValidateClass()
    SfDatePicker<TValue>.Width
    SfDatePicker<TValue>.ZIndex
    SfInputTextBase<TValue>._value
    SfInputTextBase<TValue>.APPEND
    SfInputTextBase<TValue>.APPEND_ICON
    SfInputTextBase<TValue>.ARIA_DISABLED
    SfInputTextBase<TValue>.BaseAutocomplete
    SfInputTextBase<TValue>.CLEAR_ICON_HIDE
    SfInputTextBase<TValue>.ClearElement
    SfInputTextBase<TValue>.CLEARICONHIDE
    SfInputTextBase<TValue>.ComponentReference
    SfInputTextBase<TValue>.ContainerAttr
    SfInputTextBase<TValue>.containerAttributes
    SfInputTextBase<TValue>.CONTROL_CONTAINER
    SfInputTextBase<TValue>.CONTROL_OLD_CONTAINER
    SfInputTextBase<TValue>.CssClass
    SfInputTextBase<TValue>.DataId
    SfInputTextBase<TValue>.DECREMENT
    SfInputTextBase<TValue>.DECREMENT_TITLE
    SfInputTextBase<TValue>.DecrementTitle
    SfInputTextBase<TValue>.DISABLE
    SfInputTextBase<TValue>.DISABLE_ICON
    SfInputTextBase<TValue>.DISABLED_ATTR
    SfInputTextBase<TValue>.Enabled
    SfInputTextBase<TValue>.EnablePersistence
    SfInputTextBase<TValue>.EnableRtl
    SfInputTextBase<TValue>.FLOATINPUT
    SfInputTextBase<TValue>.FloatLabel
    SfInputTextBase<TValue>.FLOATLABELBOTTOM
    SfInputTextBase<TValue>.FLOATLABELTOP
    SfInputTextBase<TValue>.FLOATTEXT
    SfInputTextBase<TValue>.GROUP_ICON
    SfInputTextBase<TValue>.ID
    SfInputTextBase<TValue>.INCREMENT
    SfInputTextBase<TValue>.INCREMENT_TITLE
    SfInputTextBase<TValue>.IncrementTitle
    SfInputTextBase<TValue>.INPUT
    SfInputTextBase<TValue>.inputAttr
    SfInputTextBase<TValue>.InputEditContext
    SfInputTextBase<TValue>.INPUTFOCUS
    SfInputTextBase<TValue>.INPUTGROUP
    SfInputTextBase<TValue>.IsClearButtonClicked
    SfInputTextBase<TValue>.IsFocused
    SfInputTextBase<TValue>.ListOfButtons
    SfInputTextBase<TValue>.MULTILINE
    SfInputTextBase<TValue>.MultilineInput
    SfInputTextBase<TValue>.OnChangeHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.OnInputHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.OnPasteHandler(ClipboardEventArgs)
    SfInputTextBase<TValue>.PREPEND
    SfInputTextBase<TValue>.PREPEND_ICON
    SfInputTextBase<TValue>.SetEnabled()
    SfInputTextBase<TValue>.SPACE
    SfInputTextBase<TValue>.SPIN_DOWN
    SfInputTextBase<TValue>.SPIN_UP
    SfInputTextBase<TValue>.ValidateOnInput
    SfInputTextBase<TValue>.Value
    SfInputTextBase<TValue>.ValueChanged
    SfInputTextBase<TValue>.WireClearBtnEvents()
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.CurrentCulture
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.IsDateOnlyType()
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.IsDateTimeOffsetType()
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ACTIVE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ARIA_EXPANDED
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.BODY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CALENDAR_CELL_CONTAINER
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CalendarBaseInstance
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CalendarClass
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ChangedEventArgs
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ChangeEvent(System.EventArgs, System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ChangeHandler(Microsoft.AspNetCore.Components.ChangeEventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ChildContent
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CLOSE_ICON
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CloseIconClass
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ClosePopup()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.CONTAINER_CLASS
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ConvertGeneric(System.DateTime)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DATE_CONTAINER
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DATE_PICKER
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DateIcon
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DateIconHandler()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DatePickerParent
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DAY_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DAY_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DAYOFWEEK_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.DAYOFWEEK_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.FocusHandler(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.FocusOutHandler(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.GetClientProperties()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.GetDefaultCulture()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.HidePopup(System.EventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.HideTimePopup()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.HOUR_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.HOUR_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.INPUT_FOCUS
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.InvokeBlurEvent(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.InvokeChangeEvent(System.EventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.InvokeFocusEvent(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.InvokeOpenEvent(System.Boolean, System.EventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsCalendarRender
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsCalendarRendered
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsDatePickerPopup
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsDateTimeType()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsDevice
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsExtendedDevicePopup()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.IsListRender
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.KeyboardTimePopupAction()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MaskPlaceholderDictionary
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MINUTE_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MINUTE_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MODEL
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MODEL_DAY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MODEL_HEADER
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MODEL_MONTH
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MODEL_YEAR
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ModelDay
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ModelMonth
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ModelYear
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MONTH_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MONTH_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.MouseIconHandler(System.EventArgs, System.String)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.OnAfterRenderAsync(System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.OnInitializedAsync()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.OnParametersSetAsync()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.POPUP
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.POPUP_EXPAND
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.POPUP_HOLDER
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PopupCloseHandler()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PopupContainer
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PopupElement
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PopupEventArgs
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PopupHolderEle
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.PreviousElementValue
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.READ_ONLY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ROOT
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ScrollToNextSection(System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.SECOND_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.SECOND_LOCALE_VALUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.SelectCalendar(System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.ShowPopupCalendar
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.StrictModeUpdate(System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.TimeIconHandler(System.EventArgs)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.TRUE
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.UpdateChildProperties(System.Object)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.UpdateErrorClass()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.UpdateFieldSetStatus(System.Boolean)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.UpdateInput()
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.UpdateValue(System.Object)
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.YEAR_LOCALE_KEY
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.YEAR_LOCALE_VALUE
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BlurHandler(System.String, System.Boolean)
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ClickStopPropagation
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ContainerClass
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.IsValueTemplate
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MouseDowSpinnerPrevent
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MousePreventContainer
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnBlur
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnChange
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnFocus
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnInput
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnPaste
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.PreventIconHandler
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.RootClass
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.SpinButton
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueExpression
    Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueTemplate
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfDateTimePicker<TValue> : SfDatePicker<TValue>, IMaskPlaceholder
    Type Parameters
    Name Description
    TValue

    Specifies the type of the SfDateTimePicker<TValue> component. This can be System.DateTime, System.Nullable<>, System.DateTimeOffset, or System.Nullable<>.

    Remarks

    The SfDateTimePicker<TValue> component extends the SfDatePicker<TValue> to provide both date and time selection capabilities. It includes a time popup list with configurable time intervals, time format options, and time range restrictions. The component supports various data types through the generic TValue parameter and provides comprehensive validation for both date and time values.

    Examples
    <SfDateTimePicker TValue="DateTime?" @bind-Value="@SelectedDateTime" 
                      Min="@MinDateTime" Max="@MaxDateTime" 
                      MinTime="@MinTime" MaxTime="@MaxTime"
                      Step="30" TimeFormat="HH:mm">
    </SfDateTimePicker>
    
    @code {
        DateTime? SelectedDateTime = DateTime.Now;
        DateTime MinDateTime = new DateTime(2024, 1, 1, 9, 0, 0);
        DateTime MaxDateTime = new DateTime(2024, 12, 31, 18, 0, 0);
        DateTime MinTime = new DateTime(2024, 1, 1, 9, 0, 0);
        DateTime MaxTime = new DateTime(2024, 1, 1, 18, 0, 0);
    }

    Basic usage of the DateTimePicker component:

    <SfDateTimePicker TValue="DateTime" Value="DateTime.Now" Format="dd/MM/yyyy HH:mm">
    </SfDateTimePicker>

    Constructors

    SfDateTimePicker()

    Declaration
    public SfDateTimePicker()

    Properties

    Max

    Gets or sets the maximum date and time value that can be selected in the SfDateTimePicker<TValue> component.

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

    A System.DateTime value that represents the maximum date and time that can be selected. The default value is December 31, 2099 at 23:59:59.

    Overrides
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.Max
    Remarks

    The Max property defines the latest date and time that can be selected in the DateTimePicker component. When combined with the MaxTime property, the following behaviors apply:

    • If MaxTime is greater than the current Max property's time, the component will prioritize the Max property.
    • If MaxTime is less than the current Max property's time, the component will prioritize the MaxTime property.
    Users will not be able to select any date and time beyond this maximum value.
    Examples
    <SfDateTimePicker TValue="DateTime?" Max="@MaxDateTime">
    </SfDateTimePicker>
    
    @code {
        DateTime MaxDateTime = new DateTime(2024, 12, 31, 23, 59, 59);
    }

    MaxTime

    Gets or sets the maximum time that can be selected in the time popup of the SfDateTimePicker<TValue> component.

    Declaration
    public DateTime MaxTime { get; set; }
    Property Value
    Type Description
    System.DateTime

    A System.DateTime value representing the maximum selectable time. The default value is December 31, 2099 at 23:59:59.

    Remarks

    The MaxTime property restricts the time selection for all dates except the specific date defined by the Max property. The following behaviors apply when both MaxTime and Max are configured:

    • If MaxTime is greater than the current Max property's time component, the component will prioritize the Max property.
    • If MaxTime is less than the current Max property's time component, the component will prioritize the MaxTime property.
    This property is particularly useful for setting business hours or operational time limits across all selectable dates.
    Examples
    <SfDateTimePicker TValue="DateTime?" MinTime="@MinTime" MaxTime="@MaxTime">
    </SfDateTimePicker>
    
    @code {
        DateTime MinTime = new DateTime(2024, 8, 6, 9, 0, 0);
        DateTime MaxTime = new DateTime(2024, 8, 6, 18, 0, 0);
    }

    Min

    Gets or sets the minimum date and time value that can be selected in the SfDateTimePicker<TValue> component.

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

    A System.DateTime value that represents the minimum date and time that can be selected. The default value is January 1, 1900 at 00:00:00.

    Overrides
    Syncfusion.Blazor.Calendars.CalendarBase<TValue>.Min
    Remarks

    The Min property defines the earliest date and time that can be selected in the DateTimePicker component. When combined with the MinTime property, the following behaviors apply:

    • If MinTime is less than the current Min property's time, the component will prioritize the Min property.
    • If MinTime is greater than the current Min property's time, the component will prioritize the MinTime property.
    Users will not be able to select any date and time before this minimum value.
    Examples
    <SfDateTimePicker TValue="DateTime?" Min="@MinDateTime">
    </SfDateTimePicker>
    
    @code {
        DateTime MinDateTime = new DateTime(2024, 1, 1, 0, 0, 0);
    }

    MinTime

    Gets or sets the minimum time that can be selected in the time popup of the SfDateTimePicker<TValue> component.

    Declaration
    public DateTime MinTime { get; set; }
    Property Value
    Type Description
    System.DateTime

    A System.DateTime value representing the minimum selectable time. The default value is January 1, 1900 at 00:00:00.

    Remarks

    The MinTime property restricts the time selection for all dates except the specific date defined by the Min property. The following behaviors apply when both MinTime and Min are configured:

    • If MinTime is less than the current Min property's time component, the component will prioritize the Min property.
    • If MinTime is greater than the current Min property's time component, the component will prioritize the MinTime property.
    This property is particularly useful for setting business hours or operational time limits across all selectable dates.
    Examples
    <SfDateTimePicker TValue="DateTime?" MinTime="@MinTime" MaxTime="@MaxTime">
    </SfDateTimePicker>
    
    @code {
        DateTime MinTime = new DateTime(2024, 8, 6, 9, 0, 0);
        DateTime MaxTime = new DateTime(2024, 8, 6, 18, 0, 0);
    }

    ScrollTo

    Gets or sets the scroll bar position in the time popup list when no value is selected or the given value is not present in the DateTimePicker popup list.

    Declaration
    public Nullable<DateTime> ScrollTo { get; set; }
    Property Value
    Type Description
    System.Nullable<System.DateTime>

    A System.Nullable<> value that represents the scroll position in the time popup list. The default value is null.

    Remarks

    The ScrollTo property determines the initial scroll position of the time popup list. When set, the time popup will scroll to the specified time value, making it visible in the dropdown. If the specified time is not available in the popup list or if no value is provided, the component will use this property to set the scroll position.

    Examples
    <SfDateTimePicker TValue="DateTime?" ScrollTo="@ScrollPosition">
    </SfDateTimePicker>
    
    @code {
        DateTime? ScrollPosition = new DateTime(2024, 1, 1, 14, 30, 0);
    }

    Step

    Gets or sets the time interval between adjacent time values in the time popup list of the SfDateTimePicker<TValue> component.

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

    An int value that specifies the time interval in minutes between two adjacent time values in the time popup list. The default value is 30 minutes.

    Remarks

    The Step property controls the granularity of time selection in the dropdown list. For example, if set to 30 minutes, the time options will appear as 00:00, 00:30, 01:00, 01:30, and so on. Smaller values provide finer time selection granularity, while larger values reduce the number of available options in the dropdown. The step value must be a positive integer representing minutes.

    Examples
    <SfDateTimePicker TValue="DateTime?" Step="15">
    </SfDateTimePicker>
    
    <!-- This creates time intervals of 15 minutes: 00:00, 00:15, 00:30, 00:45, etc. -->

    TimeFormat

    Gets or sets the format of the time value to be displayed in the time popup list of the SfDateTimePicker<TValue> component.

    Declaration
    public string TimeFormat { get; set; }
    Property Value
    Type Description
    System.String

    A string value that specifies the time format pattern for the time popup list. The default value is null.

    Remarks

    The TimeFormat property allows you to customize how time values appear in the dropdown list. You can use standard .NET DateTime format strings such as "HH:mm", "hh:mm tt", "H:mm", etc. If not specified, the component will use the default time format based on the current culture. This property only affects the display format in the time popup list and does not change the actual value format.

    Examples
    <SfDateTimePicker TValue="DateTime?" TimeFormat="HH:mm">
    </SfDateTimePicker>
    
    <!-- Displays time in 24-hour format: 09:30, 14:45, etc. -->
    
    <SfDateTimePicker TValue="DateTime?" TimeFormat="hh:mm tt">
    </SfDateTimePicker>
    
    <!-- Displays time in 12-hour format with AM/PM: 09:30 AM, 02:45 PM, etc. -->

    TimeIcon

    Gets or sets the CSS class string for the time icon displayed in the component.

    Declaration
    protected string TimeIcon { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the CSS classes applied to the time icon. The default value is derived from TIME_ICON constant.

    Remarks

    This property controls the appearance and styling of the time icon that users click to open the time selection popup. The icon's visual state can change based on user interactions and component state.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder
    Overrides
    Syncfusion.Blazor.Calendars.SfDatePicker<TValue>.BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder)

    ShowDatePopup()

    Opens the date picker popup to display the calendar for date selection.

    Declaration
    public Task ShowDatePopup()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method specifically sets the popup mode to date picker and opens the calendar popup. It provides an alternative way to open the date selection popup programmatically.

    Examples

    Opening the date popup:

    private async Task ShowCalendar()
    {
        await dateTimePicker.ShowDatePopup();
    }

    ShowDatePopupAsync()

    Opens the date picker popup to show the calendar for date selection.

    Declaration
    public Task ShowDatePopupAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method programmatically opens the calendar popup, allowing users to select a date. It's useful for implementing custom UI behaviors or keyboard shortcuts that should open the date picker.

    Examples

    Opening the date popup programmatically:

    @ref SfDateTimePicker<DateTime> dateTimePicker;
    
    private async Task OpenCalendar()
    {
        await dateTimePicker.ShowDatePopupAsync();
    }

    ShowTimePopupAsync()

    Opens the time picker popup to show the time selection list.

    Declaration
    public Task ShowTimePopupAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method programmatically opens the time selection popup, displaying a list of available time options based on the configured step interval. The time icon is also activated to reflect the popup state. It's useful for implementing custom behaviors that need to show the time picker.

    Examples

    Opening the time popup programmatically:

    @ref SfDateTimePicker<DateTime> dateTimePicker;
    
    private async Task OpenTimeList()
    {
        await dateTimePicker.ShowTimePopupAsync();
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved