Jquery function performs operation when it receives date

Asked

Viewed 27 times

0

Hello, I have a function in Jquery that receives a date parameter in the form Y-m-d, but when I receive this data it does a mathematical subtraction operation and returns the result. I took a look at the forum and found no similar doubt, someone could give me a help?

function funcao(id_cliente,data) { 
   alert(data);
} 

Example: sending the 2018-09-18 value, it treats as 1991.

  • 3

    Sending date in quotes? '2018-09-18'

  • as @Victorlaio commented, it seems that is passing the values as 2018-09-18, what making the calculation, gives 1991, and not '2018-09-18'

  • So I asked if you’re sending in quotes and yet he keeps performing the calculations, because @Alisson didn’t post an example of the method call...

No answers

Browser other questions tagged

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