You can easily build a function to get the number of days left until a date:
function daysUntil(year, month, day) {
var now = new Date(),
dateEnd = new Date(year, month - 1, day),
days = (dateEnd - now) / 1000/60/60/24;
return Math.round(days);
}
daysUntil(2009, 12, 25);
source
share