I made a dropin for this as soon as you installed / added it so you can:
moment().endOf('month').subtract(1,'w').nextDay(1)
This code gets the end of the month, minus 1 week, and then next Monday.
To simplify this, you can do:
days = moment().allDays(1)
who receives all Mondays a month, and then selects the first.
You can simplify it as follows:
moment().allDays(1).pop()
But this removes Monday from the list, but if you do not use the list (as in the example above), it does not matter. If so, you may want this:
moment().allDays(1).last()
But this requires pollyfill:
if (!Array.prototype.last){ Array.prototype.last = function(){ return this[this.length - 1]; }; };
source share