0

My model has a DateTime property that accepts user input. Users will be needing to specify times with milliseconds (ex: 01/06/2014 01:49:36.585)

I tried using a DateTime picker, I tried using a textbox, but clientside validation fails for each with the error "The field x must be a date."

I was thinking I could turn off clientside validation and write a model binder that converts a string to a datetime, but there must be an easier way to do that. Any suggestions?

chani
  • 793
  • 1
  • 7
  • 21
  • http://stackoverflow.com/questions/511439/custom-date-format-with-jquery-validation-plugin – Dilish Jan 07 '14 at 01:00
  • Thanks for the link -- now that I take a look at the validation code, looks like it's failing to parse the date and then failing because it thinks the property is null. Do you know which .js file the datetime parsing happens in? – chani Jan 07 '14 at 01:12
  • If you are using the Date.parseExact function, you should add reference to date.js – Dilish Jan 07 '14 at 01:19

0 Answers0