DateTimeEdit

The DateTimeEdit component renders a date/time picker for Dataverse date and time columns. It supports date-only, time-only, and combined date and time modes.

<DateTimeEdit ColumnName="ppp_birthdate" />

Editor Type

Set EditorType to choose between DateTimeEditorType.DateTime (default), DateTimeEditorType.DateOnly, or DateTimeEditorType.TimeOnly.

<!-- Date and time (default) -->
<DateTimeEdit ColumnName="ppp_birthdate" EditorType="DateTimeEditorType.DateTime" />

<!-- Date only -->
<DateTimeEdit ColumnName="ppp_birthdate" EditorType="DateTimeEditorType.DateOnly" />

<!-- Time only -->
<DateTimeEdit ColumnName="ppp_birthdate" EditorType="DateTimeEditorType.TimeOnly" />

Disabling Dates

Use the DisabledDateFunc parameter to provide a function that returns true for dates that should be disabled in the calendar picker.

<DateTimeEdit ColumnName="ppp_birthdate"
              DisabledDateFunc="@(date => date > DateTime.Today)" />

DateTimeEdit

Here is an example that demonstrates the use of a DateTimeEdit component.

Example

DateTimeEdit (Extended Properties)

This demonstrates the most common properties that are availabe to set on the DateTimeEdit.

Example
Readonly? Required? Disabled? Date & TimeDate OnlyTime Only

** Note ** Future dates are disabled based on the DisabledDateFunc.

DateTimeEdit Class

Parameters

Name
Type
Default
Description
ChildContentRenderFragment?
Child content of the component
ColumnNamestring
Column logical name to bind the editor to from the table record.
Descriptionstring?
Description to be displayed in the tooltip.
Disabledbool?
Should the editor be disabled.
DisabledDateFuncFunc<DateTime, bool>?
Function to know if a specific day must be disabled.
DisplayLabelWhenAvailablebool
True
Specifies whether to display a lable if available.
DisplayTooltipWhenAvailablebool
True
Specifies whether to display a tooltip if available.
DisplayValidationErrorMessagebool
True
Should a validation error message be displayed when the component fails validation?
EditorTypeDateTimeEditorType?
Determines which editors are displayed for the column.
IsVisiblebool
True
Is the editor visible.
Labelstring?
Text to be displayed as a label for the editor.
ReadOnlybool?
Should the editor be read-only.
Requiredbool?
Should the value be required.
ValueDateTime?
Value of the column.
Name: ChildContent
Type: RenderFragment?
Description: Child content of the component
Name: ColumnName
Type: string
Description: Column logical name to bind the editor to from the table record.
Name: Description
Type: string?
Description: Description to be displayed in the tooltip.
Name: Disabled
Type: bool?
Description: Should the editor be disabled.
Name: DisabledDateFunc
Type: Func<DateTime, bool>?
Description: Function to know if a specific day must be disabled.
Name: DisplayLabelWhenAvailable
Type: bool
Default: True
Description: Specifies whether to display a lable if available.
Name: DisplayTooltipWhenAvailable
Type: bool
Default: True
Description: Specifies whether to display a tooltip if available.
Name: DisplayValidationErrorMessage
Type: bool
Default: True
Description: Should a validation error message be displayed when the component fails validation?
Name: EditorType
Type: DateTimeEditorType?
Description: Determines which editors are displayed for the column.
Name: IsVisible
Type: bool
Default: True
Description: Is the editor visible.
Name: Label
Type: string?
Description: Text to be displayed as a label for the editor.
Name: ReadOnly
Type: bool?
Description: Should the editor be read-only.
Name: Required
Type: bool?
Description: Should the value be required.
Name: Value
Type: DateTime?
Description: Value of the column.

Events

Name
Type
Description
ValueChangedEventCallback<ColumnValueBase>
Gets or sets a callback that updates the bound value.
Name: ValueChanged
Type: EventCallback<ColumnValueBase>
Description: Gets or sets a callback that updates the bound value.

Methods

Name
Parameters
Type
Description
GetValidationErrorsList<string>
Returns a collection of the current validation errors.
Name: GetValidationErrors
Type: List<string>
Description: Returns a collection of the current validation errors.