'How to format <InputDate> to "dd/MM/yyyy" in Blazor Webassembly

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:

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"?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source