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
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 ...

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.