Get last monday in month in moment.js

前端 未结 4 1465
梦毁少年i
梦毁少年i 2021-01-12 06:51

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\')

B

4条回答
  •  北海茫月
    2021-01-12 06:52

    you get always monday with isoweek:

    moment().endOf('month').startOf('isoweek')
    

提交回复
热议问题