how do i add a month to my date constant?
my variable receives an input with the date format I want to take this variable and each click add an extra month to it
I’ve tried using the gets and sets and nothing so far, like this : .getMonth()
how do i add a month to my date constant?
my variable receives an input with the date format I want to take this variable and each click add an extra month to it
I’ve tried using the gets and sets and nothing so far, like this : .getMonth()
3
Answers
Here’s a function that will do it for you.
This should add 1 more month to you Date:
I feel getMonth should solve your problem assuming the input date is a date-type variable. Just wrote a sample code for the same.