Created
October 11, 2017 08:23
-
-
Save js2me/c02b3a7cbf483c1c85506b6eb98a5759 to your computer and use it in GitHub Desktop.
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