DateOnly C# doesn't bind in razor page

784 views Asked by At

I'm using DateOnly property. When I bind it in input it doesn't bind in default date time picker while I'm in my update view. Though When I inspect it the "input" element has value but it doesn't bind in my calender. Is this due to new DateOnly Property.?? As when I was using DateTimeOffset it was perfectly working

1

There are 1 answers

0
Xinran Shen On

DateOnly and TimeOnly hasn't support full Model Binding freature in .Net 6(refer to this github issue), I have tested that It has been provided in .Net 7.

If you want to use DateOnly, you can try to use JsonConverter, Refer to link.