|
Ok so this is what i've come up with.
function date_addmonth(strDate,duration)
{
var mydate = strDate
var day =(mydate.substring(0,2))
var month = (mydate.substring(3,5))
var year = (mydate.substring(6,10))
alert(day)
alert(month)
alert(year)
month = Number(month) + duration
var testdate = new Date(month +"/" + day +"/" + year )
alert(testdate)
}
This function reads in a date in a string format dd/mm/yyyy i.e English date not US date. I then use substring to seperate out the day month year.
Add the duration and then build up a new date with the day month swicth round
Last edited by higginbt : 06-08-2006 at 07:36 AM.
|