gingerj
12-29-2005, 10:48 AM
Hi all, I've been constructing a web interface to produce link urls automatically (dont ask the boss wants it).
But I've got a bit stuck...
I'm using the Javascript Date function to automatically load the current day/month/year into some text boxes.
Now I need to add a week(+7) onto the current dates, and fill in another set of day/month/year text boxes. But when I do:
document.linkbuilder.dday.value = theday.getDate()+7;
It's not rolling the dates over, so todays date is the 29th and I'm getting 36. So how do I work this problem out cos I'm no Javascript programmer by any means.
I think I need to:
1) Get the current date + 7
2) If it's over 28/30/31 then take new date and get the difference
3) with the difference add it to 1 so get the proper date....?
How?
But I've got a bit stuck...
I'm using the Javascript Date function to automatically load the current day/month/year into some text boxes.
Now I need to add a week(+7) onto the current dates, and fill in another set of day/month/year text boxes. But when I do:
document.linkbuilder.dday.value = theday.getDate()+7;
It's not rolling the dates over, so todays date is the 29th and I'm getting 36. So how do I work this problem out cos I'm no Javascript programmer by any means.
I think I need to:
1) Get the current date + 7
2) If it's over 28/30/31 then take new date and get the difference
3) with the difference add it to 1 so get the proper date....?
How?