I am trying to get the remaining days of the year when a user exits a textbox. I have a date picker to get the date and found a script that I am modifying except its not going as planned.
I pass the date from the box to the fucntion but I always get a "d1.getYear() is not a function" error. I assume that once I get to the month and date I will have this same problem.
function days_between(d1) {
var date1 = new Date()
date1.setYear(d1.getYear())
date1.setMonth(d1)
date1.setDate(d1)
alert(date1);
...
}
I am not that proficient with js. Any ideas?
I pass the date from the box to the fucntion but I always get a "d1.getYear() is not a function" error. I assume that once I get to the month and date I will have this same problem.
function days_between(d1) {
var date1 = new Date()
date1.setYear(d1.getYear())
date1.setMonth(d1)
date1.setDate(d1)
alert(date1);
...
}
I am not that proficient with js. Any ideas?