HTML-5 date field shows as “mm/dd/yyyy” in Chrome, even when valid date is set

前端 未结 5 1207
慢半拍i
慢半拍i 2020-12-29 00:55

I just upgraded an ASP.Net MVC application to MVC-4. The field editor for inputs based on DateTime values now include\'s the HTML-5 type="date" attrib

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 01:40

    If you are dealing with a table and one of the dates happens to be null, you can code it like this:

      @{
         if (Model.SomeCollection[i].date_due == null)
           {
             
           }
           else
           {
             
           }
       }
    

提交回复
热议问题