Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to format to "dd/MM/yyyy" in Blazor Webassembly

$
0
0

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


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>