Spent now a few hours already. How to achive same format in Datepicker like in Razor component?
Asked
Active
Viewed 53 times
1 Answers
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