Jump to content

adding dates on second input box


TheJuan

Recommended Posts

I searched and searched but could not find a idea that can light me. if anyone point me to article or tutorial on this would be appreciated.

 

i have two input textbox for dates, one is date borrowed

which from date picker calendar 07/21/2009

and what i would like to make is the second textbox would be auto compute for X months

 

the second input textbox would automatic display a value  01/21/2010 if i assign a 6 months variable

 

more power.

Link to comment
https://forums.phpfreaks.com/topic/166747-adding-dates-on-second-input-box/
Share on other sites

Try to parse date manually. If you are using leading zeroes it is trivial.

Month is parseInt(datefield.substr(0,2))

Day is parseInt(datefield.substr(3,2))

Year is parseInt(datefield.substr(5,2))

Then increase month and check if greater than 11 (month is 0-11)...

Concatenate parts ...

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.