InputDateTime<TValue> Class
An input component for editing date and time values using the HTML datetime-local input type.
public class InputDateTime<TValue> : InputDate<TValue>Type parameters
TValue- The type of the value. Supported types are
DateTime,DateTimeOffset, and their nullable variants.
- Inheritance
InputDate<TValue>InputDateTime<TValue>
Constructors
| Name | Description |
|---|---|
| InputDateTime() |
InputDateTime()
public InputDateTime()No documentation is available.
Properties
| Name | Description |
|---|---|
| Offset | Gets or sets the UTC offset to apply when the bound value is a DateTimeOffset. An HTML datetime-local input carries no timezone, so without this the offset of the machine running the component is used, which is the server's offset under Blazor Server rather than the user's. Use TimeZoneService to obtain the user's offset. |
Offset
InputDatetime.csGets or sets the UTC offset to apply when the bound value is a DateTimeOffset. An HTML datetime-local input carries no timezone, so without this the offset of the machine running the component is used, which is the server's offset under Blazor Server rather than the user's. Use TimeZoneService to obtain the user's offset.
public TimeSpan? Offset { get; set; }Property value
Methods
| Name | Description |
|---|---|
| BuildRenderTree(RenderTreeBuilder) | Renders the component to the supplied RenderTreeBuilder. |
| FormatValueAsString(TValue?) | Formats the value as a string. Derived classes can override this to determine the formatting used for InputBase<TValue>.CurrentValueAsString. |
| TryParseValueFromString(string?, TValue, string?) | Parses a string to create an instance of TValue. Derived classes can override this to change how InputBase<TValue>.CurrentValueAsString interprets incoming values. |
BuildRenderTree(RenderTreeBuilder)
InputDatetime.csRenders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder builder)Parameters
builderRenderTreeBuilder- A
RenderTreeBuilderthat will receive the render output.
FormatValueAsString(TValue?)
InputDatetime.csFormats the value as a string. Derived classes can override this to determine the formatting used for InputBase<TValue>.CurrentValueAsString.
protected override string FormatValueAsString(TValue? value)TryParseValueFromString(string?, TValue, string?)
InputDatetime.csParses a string to create an instance of TValue. Derived classes can override this to change how InputBase<TValue>.CurrentValueAsString interprets incoming values.