Date input tag helper is not showing the date from database

后端 未结 2 2036
春和景丽
春和景丽 2021-01-02 09:28

When I use the following code in my edit view, it doesn\'t show the date from the model.


         


        
2条回答
  •  渐次进展
    2021-01-02 09:46

    For me it was really confusing, what needs to delete and what not. what I did -

     [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
     public virtual DateTime CalledOn { get; set; }
    

    View, I've taken input type="text" not datetime, date or datetime-local

     

    Date Picket form Bootstrap

     $(".date").datepicker({
                    format: 'dd/mm/yyyy'
            });
    

提交回复
热议问题