Hi all,
I can't seem to figure out what is wrong with my code. Maybe it would be simpler to just compare date and not time. Not sure how to do this either and I searched but couldn't find my exact problem.
BTW, when I display the two dates in an alert, they show as exactly the same.
My code:
window.addEvent('domready', function() {
var now = new Date();
var input = $('datum').getValue();
var dateArray = input.split('/');
var userMonth = parseInt(dateArray[1])-1;
var userDate = new Date();
userDate.setFullYear(dateArray[2], userMonth, dateArray[0], now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
if(userDate > now)
{
alert(now+'\n'+userDate);
}
});
Perhaps there is a simpler way to compare dates and not including the time.
Hope someone has an answer...
Thanks!