Open elaine-jackson opened 4 years ago
Interesting in that the tag helper should be formatting it based on the code at https://github.com/dotnet/aspnetcore/blob/90e89e970877a39cb048bb6f0e59551351f661c3/src/Mvc/Mvc.TagHelpers/src/InputTagHelper.cs#L468 and it's not. That block of code acknowledges the required RFC for filling to value attribute.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
Describe the bug
When using an asp-for input, if displaying a default value (for example an edit form), by default unlike with strings or numbers, the date is not available and it's blank. To fix this you currently have to overwrite the
value=
attribute to inject the YYYY-MM-DD. Based on how other values are handled, this should be done implicitly. The bug is that instead of YYYY-MM-DD, you get a C# style DateTime string which isn't supported by the HTML5 standard. It needs to be converted before being passed to the user. I noticed that a DateTime input is not included in the MVC unit tests.To Reproduce
Create a form using asp-for tag helper that modifies a stored date object.
Further References:
I found the following information when tracking down this bug.
Further technical details