Closed
Description
Related to: dotnet/aspnetcore#36511
Description
DateTime
can be converted from string (TypeDescriptor.GetConverter(typeof(DateTime)).ConvertFromString("01.01.0001")
), while DateOnly
and TimeOnly
cannot. This causes some issues. For example, if they are added as query parameters in Asp.Net, they would be represented as 6 and 5 fields respectively instead of one string field (see dotnet/aspnetcore#36511 for more info).
For now, I've created a NuGet with custom type converters to solve this: https://github.com/maxkoshevoi/DateOnlyTimeOnly.AspNet/tree/main/DateOnlyTimeOnly.AspNet/Converters/Type
Are there any plans to enable string
to DateOnly/TimeOnly
conversion?
Regression?
No