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" /><DateTimeEdit ColumnName="ppp_birthdate" />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} /><!-- 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" />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 > new Date()}
/><DateTimeEdit ColumnName="ppp_birthdate"
DisabledDateFunc="@(date => date > DateTime.Today)" />A basic DateTimeEdit bound to a date/time column.
Use the controls below to explore the available properties.
** Note ** Future dates are disabled based on the DisabledDateFunc.
Name | Type | Default | Description |
|---|---|---|---|
ChildContent | RenderFragment? | Child content of the component | |
ColumnName* | string | Column logical name to bind the editor to from the table record. | |
Description | string? | Description to be displayed in the tooltip. | |
Disabled | bool? | Should the editor be disabled. | |
DisabledDateFunc | Func<DateTime, bool>? | Function to know if a specific day must be disabled. | |
DisplayLabelWhenAvailable | bool | True | Specifies whether to display a lable if available. |
DisplayTooltipWhenAvailable | bool | True | Specifies whether to display a tooltip if available. |
DisplayValidationErrorMessage | bool | True | Should a validation error message be displayed when the component fails validation? |
EditorType | DateTimeEditorType? | Determines which editors are displayed for the column. | |
IsVisible | bool | True | Is the editor visible. |
Label | string? | Text to be displayed as a label for the editor. | |
ReadOnly | bool? | Should the editor be read-only. | |
Required | bool? | Should the value be required. | |
Value | DateTime? | Value of the column. |
ChildContentColumnName*DescriptionDisabledDisabledDateFuncDisplayLabelWhenAvailableDisplayTooltipWhenAvailableDisplayValidationErrorMessageEditorTypeIsVisibleLabelReadOnlyRequiredValueName | Type | Description |
|---|---|---|
ValueChanged | EventCallback<ColumnValueBase> | Gets or sets a callback that updates the bound value. |
ValueChangedName | Parameters | Type | Description |
|---|---|---|---|
GetValidationErrors | List<string> | Returns a collection of the current validation errors. |
GetValidationErrors