Some weekday magic by me - Ben
It's under the CC-0.
Do one of these things
- Copy & Paste the CoffeeScript or compiled JS into your code.
- Use the html tag:
<script src="https://gist.github.com/penne12/ae44799b7e94ce08753a/raw/moment-daysoftheweek-plus.js"></script>
You can do this now:
moment().firstDayOfMonth() //=> moment().date(1)
or this:
moment().nextDay(1) //=> the next monday
moment().nextDay(5) //=> the next friday
or this:
moment().firstDay(1) //=> the first monday of the month
moment().firstDay(3) //=> the first wednesday of the month
or this:
moment().day(1).allDaysRemainingInMonth() //=> The week's monday, and all the other mondays remaning in the month
moment().day(3).allDaysRemainingInMonth() //=> The week's wednesday, and all the other mondays remaning in the month
or this:
moment().allDays(1) //=> All the mondays in this month
moment().allDays(3) //=> All the wednesdays in this month
so yeah - it's somewhat cool.