js 根据n年第n周,获取此周的开始和结束日期
文章目录
<script src="C:\Users\admin\Desktop\moment.js"></script>
<script>
const year = 2022
const week = 29
let weekdays = []
weekdays[0] = moment(`${year}-${week}`, 'GGGG-WW').format('YYYY.MM.DD')
weekdays[1] = moment(`${year}-${week}`, 'GGGG-WW').weekday(7).format('YYYY.MM.DD')
console.log(weekdays);
</script>
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论