I am using AspGrid, which has a datepicker. Once submitted the form calls a javacript function called validate, where I want it to obtain the date from the form calender and add 5 days to it and alert the new date in a popup message window. My code is as follows;
var myDate = new Date(Date.parse(document.AspGridFormSave1.FIELD4.value));
For some reason the above code does not work on gives the wrong date, which I think is down to date format (I am based in the UK - dd/mm/yyyy) and/or local versus UTC.
Any help would be much appreciated as I have spent a lot of time on this!
Parse your date manually and use the Date constructor new Date(year, month [, date [, hours[, minutes[, seconds[, ms]]]]]), like explain on this page
Sorry. Try this link : http://stackoverflow.com/questions/2...ipt-date-parse
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)