I'm new to Blazor and I'm working on a Blazor Webassembly project where I need to format the DateTime input as "dd/MM/yyyy".
I already tried this:
- How to format the date using local culture using the blazor <InputDate /> tag
- Set dd/mm/yyyy in a custom InputDate component instead of 01/01/0001 in Blazor (This actaly is intresting, but thres nothing simplier?)
- Is there any way to change input type="date" format?
This is what I have:
<InputDate @bind-Value="@Model.Date1" class="form-control"/><InputDate @bind-Value="@Model.Date2" class="form-control"/><InputDate @bind-Value="@Model.Date3" class="form-control"/>The Model:
public class Model{ public DateTime? Date1{ get; set; } public DateTime? Date1{ get; set; } public DateTime? Date3{ get; set; }}Also tried this:
<input type="date" @Bind="Model.Date1" @Bind:format="dd-MM-yyyy" class="form-control"/>But nothing changed.
The result
The question is: How can I format the InputDate in "dd/MM/yyyy"?