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>

评论

暂无评论