网站首页
编程语言
数据库
系统相关
其他分享
编程问答
futureDate
2024-10-26
Vue3中取当前日期并且取当前日期的前10天和后30天。并把每个日期的日放到一个数组里面。
consttoday=newDate();//获取当前日期constdateArray=[];constdayArray=[];//计算前10天for(leti=10;i>0;i--){constpastDate=newDate(today);pastDate.setDate(today.getDate()-i);dateArray.push(