var date = new Date()
let nowDate = date.getFullYear() + '-' + (date.getMonth() + 1 >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate())
let beforDate = new Date(date.getTime() - 24 * 60 * 60 * 1000 * 30)
let beforDay = beforDate.getFullYear() + '-' + (beforDate.getMonth() + 1 >= 10 ? beforDate.getMonth() + 1 : '0' + (beforDate.getMonth() + 1)) + '-' + (beforDate.getDate() >= 10 ? beforDate.getDate() : '0' + beforDate.getDate())
this.formValidate.date = [beforDay, nowDate]
js格式化时间格式年月日(yyyy-MM-dd)
最新推荐文章于 2024-07-11 16:19:39 发布