Created
October 11, 2017 08:23
moment feature! get current week number in the current month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let moment = require('moment-timezone') || require('moment'); | |
moment.prototype.weekOfMonth = function weekOfMonth(m) { // eslint-disable-line | |
return this.week() - moment(this).startOf('month').week() + 1; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment