Skip to content

Instantly share code, notes, and snippets.

@seanmavley
Created May 8, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanmavley/91e71f63f6b89d83d1501aa982d91215 to your computer and use it in GitHub Desktop.
Save seanmavley/91e71f63f6b89d83d1501aa982d91215 to your computer and use it in GitHub Desktop.
// first day of the month
var firstDayThisMonth = moment(firstDayThisMonth).startOf('month').toDate();
Go back and forth using the subtract() and add() with the endOf() and startOf():
// last day of previous month
var yesterMonthLastDay = moment(yesterMonthLastDay).subtract(1,'months').endOf('month').toDate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment