let date = currentDate
let seperator1 = '-'
let month = date.getMonth() + 1
console.log(month, 'month..11')
let strDate = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (strDate >= 0 && strDate <= 9) {
strDate = '0' + strDate
}
currentDate = date.getFullYear() + seperator1 + month + seperator1 + strDate
console.log(currentDate, 'currentDate..')
vant日历选择日期格式化
最新推荐文章于 2024-03-12 17:21:22 发布