I use http://bootstrap-datepicker.readthedocs.org/en/release/ for datepicker with bootstrap.
[DisplayName("Date Start")]
[DataType(DataType.Date)]
public DateTime? DateFrom { get; set; }
$('.datepicker').datepicker({
format: "mm/dd/yyyy",
autoclose: true,
clearBtn: true
});
@Html.TextBoxFor(m => m.DateFrom, new { @class = "form-control datepicker", @placeholder = "Start Date" })
@Html.ValidationMessageFor(m => m.DateFrom)
Today date is 10/06/2014. When i choose date 10/13/2014 i see message "The value '10/13/2014' is not valid for Date Start." while date 10/12/2014 is OK.
Where is mistake?
10/13/2014as the 10th day of the 13th month of 2014, which is invalid. It seems that it is expecting dates indd/mm/yyyyformat instead ofmm/dd/yyyy. - Cᴏʀʏ