Skip to content

Instantly share code, notes, and snippets.

@js2me
Created October 11, 2017 08:23
moment feature! get current week number in the current month
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