ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
DatePicker DateFormat validation make me crazy
Title:
B
I
{code}
?
I have to publish my mvc application on Italian IIS there is a DatepickerFor to set the correct date format I set .DateFormat("dd-MM-yyyy") the date is showed ok, but always give me a validation error. but if set .DateFormat("MM/dd/yyyy") validate correctly (but date is showed in bad format) If it possible to set a format to show and another to validate ?
Save Changes
Cancel
mtugnoli
asked at 16 Jun 2015
Answers
B
I
{code}
?
yes it is, and this is done in the prodinner demo app: http://prodinner.aspnetawesome.com note that you can change the language in the top right corner, and when you do that, the format of the DateTime also changes ( in the datepicker ) and the validation works every time this works because of utils.init (utils.js) that is called in _Layout.cshtml which sets the datetime format for jquery.validate and the DatePicker gets the format automatically from the current thread (unless you set it using .DateFormat )
Save Changes
Cancel
Omu
answered at 16 Jun 2015
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK