I am working on MVC and Jquery, and I had a form to create a new event for the website. On the date part, I use datepicker to show the calendar and lets user the select a date. my format is:
format: 'dd/mm/yyyy',
but when I submit the form, it always failed and told me invalid format. I found the problem was when I selected the date March 24, 2016, it set month was 24, and date was 3(means March).
what's going on here, can anyone help me? Thank you very much.
Model:
public SeminarListViewModel()
{
Documents = new List<DocumentDisplayViewModel>();
}
public string EventID {get;set;}
public string Name { get; set; }
public short Capacity { get; set; }
[DataType(DataType.Date)]
public DateTime StartDate { get; set; }
[DataType(DataType.Date)]
public DateTime EndDate { get; set; }
public List<DocumentDisplayViewModel> Documents { get; set; }
}