Problem with the property date of an object that changed from AJAX to a Web Service

1

I have a normal and current form with technology

asked by Xavier 03.02.2016 в 17:23
source

2 answers

1

You have sent the date in the wrong format for internationalization issues (i18n)

To avoid having problems with the culture or region, send the date in the format:

"yyyy-MM-dd"

Or if the culture is in Spanish

"dd/MM/yyyy"
    
answered by 03.02.2016 в 17:51
0

I can think of some alternatives

  • Define globalization in javascript, in this way you indicate a culture that matches the date format you use

globalize

With this when using ajax recognize the date in the format of the specified culture.

  • Another is to use the library

moment.js

to pause the date and convert it to the format that ajax defines (ie MM-dd-yyyy) and send it with this format This library allows you to work with dates in a very simple way.

    
answered by 03.02.2016 в 17:59