Is there a way that I get the last monday in the month with moment.js?
I know I can get the end of the month with: moment().endOf(\'month\')
moment().endOf(\'month\')
B
You're almost there. You just need to add a simple loop to step backward day-by-day until you find a Monday:
result = moment().endOf('month'); while (result.day() !== 1) { result.subtract(1, 'day'); } return result;