1
我在我的MVC 4應用程序中有bootstrap datepicker。當我點擊這個日期選擇器顯示它日期像當在MVC 4中加載數據時在Bootsrap DatePicker上刪除時間
2014/04/24
當負載C#日期時間到該日期選取它顯示
4/3/2014 12:00:00 AM
這是我的MVC視圖代碼
@Html.TextBoxFor(model => model.date, new { @class = "form-control input-sm", @data_provide = "datepicker"})
這是日期格式腳本
$(function() {
$.fn.datepicker.defaults.format = "yyyy/mm/dd";
$.fn.datepicker.defaults.language = $('html').attr('lang');
$.fn.datepicker.defaults.autoclose = true;
});
這是型號:
Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(Resources.Resources))]
[Display(Name = "Maintenance Date")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
[DataType(DataType.Date)]
public virtual DateTime date
請幫助這個,