在moment.js中获得月中的最后一个星期一 [英] Get last monday in month in moment.js
本文介绍了在moment.js中获得月中的最后一个星期一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法让我在本月的最后一个星期一用moment.js?
Is there a way that I get the last monday in the month with moment.js?
我知道我可以在月底获得:
moment()。endOf('month')
I know I can get the end of the month with:
moment().endOf('month')
但是如何关于最后一个星期一?
But how about the last monday?
推荐答案
你总是在星期一 isoweek :
moment().endOf('month').startOf('isoweek')
这篇关于在moment.js中获得月中的最后一个星期一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文