0

Spent now a few hours already. How to achive same format in Datepicker like in Razor component?

https://github.com/rmoergeli/BlazorAppDateTimeFormatIssue

enter image description here

Rene M
  • 67
  • 1
  • 6

1 Answers1

0

You can format datetime in razor:

@Model.DateField.ToString("MMM dd, yyyy")

Don't know what calendar plugins you're using but you can try flatpickr

ian
  • 82
  • 6
  • ____ "input type" is "date". Doesn't work when bind-value is a string. If "input type" is text, no Datepicker is coming up. – Rene M Aug 12 '20 at 11:58
  • From BlazorAppDateTimeFormatIssue/Pages/Index.razor, try @date.ToString("MMM dd, yyyy") – ian Aug 12 '20 at 12:10
  • Index.razor is correct, it's "de-CH" format. But Datepicker in modal window is wrong format. Of course I could make both "wrong". But it should be "de-CH" format. – Rene M Aug 12 '20 at 13:14