关于javascript:moment-去年今年上月上周等-开始时间和结束时间数组

明天:[moment(), moment()]
本周:[moment().startOf('week'), moment().endOf('week')]
上周:[moment().week(moment().week() - 1).startOf('week'), moment().week(moment().week() - 1).endOf('week')]
本月:[moment().startOf('month'), moment().endOf('month')]
上月:[moment().month(moment().month() - 1).startOf('month'), moment().month(moment().month() - 1).endOf('month')]
往年:[moment().startOf('year'), moment().endOf('year')]
去年:[moment().year(moment().year() - 1).startOf('year'), moment().year(moment().year() - 1).endOf('year')]

原文:https://blog.csdn.net/qq_42982453/article/details/91794675

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理