Я форматирую поле DateTime?
как dd/MM/yyyy
, и когда я отправляю форму, отображается ошибка проверки.
Я не понимаю, почему это происходит?
Модель
[Display(Name = "Expected Ending Time")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
public DateTime? ExpectedEndingTime { get; set; }
HTML
@Html.TextBoxFor(x => x.Requsition.ExpectedEndingTime, new { @class = "form-control dataPickerField", id = "ExpectedEndingTimeDataPicker", @readonly = true })
@Html.ValidationMessageFor(x => x.Requsition.ExpectedEndingTime)
<script>
$(function () {
$('#ExpectedEndingTimeDataPicker').datepicker({
format: 'dd/mm/yyyy',
autoclose: true
})
.on('changeDate', function (ev) {
// do things;
);
});
</script>
01/15/2014
? - person Greg Burghardt   schedule 15.01.2014