Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save iworkforthem/6ce597253462edbce4d1817ed58957d6 to your computer and use it in GitHub Desktop.

Select an option

Save iworkforthem/6ce597253462edbce4d1817ed58957d6 to your computer and use it in GitHub Desktop.
Get the firstDay & lastDay of each Quarter.
var today = new Date();
var quarter = Math.floor((today.getMonth() / 3));
var firstDay = new Date(today.getFullYear(), quarter * 3, 1);
var lastDay = new Date(firstDay.getFullYear(), firstDay.getMonth() + 3, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment