I have 2 date values, one for the current date, and one for the last day of the month.
I am trying to find the remaining days left in the current month (end of the month - current date)
The syntax for my code is a bit confusing when it comes down to finding the difference for these 2 dates.
Here is my code:
function findDays() {
var now = new Date();
var date = now.getDate();
console.log(date);
return new Date(now.getFullYear(), now.getMonth()+1, 0).getDate();
}
console.log(findDays() - (new Date(2016, 0, 1)).getDate());