c# - How to make a preselected value of a datepicker to be in format {"dd-MM-yyyy"} both on Google Chrome and Internet Explorer? -
i working on c# mvc project. in 1 of index views have column called "last cut off date" date, value is: 28/07/2016. when go edit view of row, have form , 1 of fields "last cut off date" (it datepicker field). when run project on internet explorer date preselected value: 2016-07-28 , when run project on google chrome, date preselected value: 07/28/2016. need preselected value in format: dd/mm/yyyy. how can achieve on both google chrome , internet explorer?
here code model:
[datatype(datatype.date)] [displayformat(dataformatstring="{0:yyyy-mm-dd}",applyformatineditmode = true)] public nullable<datetime> lastcutoffdate { get; set; }
in view can set output how model displayed.
@html.editorfor(model => model.lastcutoffdate, "{0:dd/mm/yyyy}", new { @class = "form-control" })
Comments
Post a Comment