I've setup a datepicker, it's showing the selected date properly but I'm having a hard time in sending it towards my controller in the same format it's showing. For some reason it seems to be reverting back from dd/MM/yyyy to MM/dd/yyyy.
I had setup my controller to accept a DateTime parameter. I changed this to accept a string (makes more sense) this allowed me to just parse the string into a DateTime in the format I needed to continue working with it.
Still if someone would have a solution to still send in a DateTime towards the controller straight away in the format I'm looking for, always nice to see how that would be done.
answered on 13 May 2015, 09:52 AM
The default model binder uses the invariant culture formats to parse the value when it is sent in the query string. So in order for the value to be bound, you should either format the query string value in the expected format:
or implement a custom model binder for the DateTime type that parses the values based on the needed format.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items