Skip to content

Instantly share code, notes, and snippets.

@ray-peters
Created December 10, 2015 18:37
Show Gist options
  • Save ray-peters/a772220bf860738bb475 to your computer and use it in GitHub Desktop.
Save ray-peters/a772220bf860738bb475 to your computer and use it in GitHub Desktop.
var getDaysLeftInMonth = function(){
var now = new Date(),
thisMonth = now.getMonth(),
thisYear = now.getFullYear(),
daysInThisMonth = new Date( thisYear, ( thisMonth + 1 ), 0 ).getDate();
return ( daysInThisMonth - now.getDate() );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment