Input Data type is returning the date reversed

Asked

Viewed 172 times

0

I have this website http://tamandareplaza.com.br/ and I’m trying to get his form to communicate with the reservation system. As can be seen in the "MAKE YOUR RESERVATION HERE" area, the date that the customer informs is in the dd/mm/yyyy format. But when it is sent, in the url it appears as yyyy/mm/dd and ends up giving a bug in the system! Why is the return sent reversed? How to solve?

  • Enter the code so we can find out. Obs: Generally, in the database, the date field of type 'date' or 'datetime' is inverted (American format)...

  • As I checked in the code of the page it uses Angular.JS for processing the date fields, using the model "date", which by default uses the American format for dates, although the display shown is DD/MM/YYYY (Day/Month/Year)this conversion is made by the angular itself. Let’s see if anyone who understands can help you... For this please edit your question and put the code for the form at least and also the part of the submission, made in javascript.

  • In the case of Angular JS, you can include locate angular-locale_pt-br.js so that it uses the library in English.

  • Can you explain where you’re going to consume that date? You’re sending it to the server and it’s going to be used in a database for example?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.