Reputation: 3
I set MudTextField's InputType
to DateTimeLocal
and bound it to the DateTime?
member, but a validation error occurs in Visual Studio 2019, using .NET 5.0 and MudBlazor 5.2.5.
<MudTextField Format="s" InputType="InputType.DateTimeLocal" @bind-Value="testdate" />
@code {
private DateTime? testdate { get; set; }
}
Form error screenshot:
As mentioned above, I tried to isolate the problem by simplifying the code as much as possible, but I can't dig any further.
I searched as much as I could, but I couldn't find a topic with the same problem.
I would like advice from someone who knows.
Upvotes: 0
Views: 299
Reputation: 650
Use: T="DateTime?"
<MudTextField T="DateTime?" Format="s" InputType="InputType.DateTimeLocal" @bind-Value="testdate" />
@code {
private DateTime? testdate { get; set; }
}
Upvotes: 1