js 获取当天的前一天和后一天
let currentTimeTimestamp = new Date(currentTime).getTime();
let prevTimeTimestamp = currentTimeTimestamp - 24 * 60 * 60 * 1000
let nextTimeTimestamp = currentTimeTimestamp + 24 * 60 * 60 * 1000
const timestampToDate = (timestamp):string=>{
const date = new Date(timestamp)
const Year = date.getFullYear()
const Month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
const Day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
const Hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
const Minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
const Second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
return Year + '-' + Day + '-' + Day + ' ' + Hour + ':' + Minute + ':' + Second
}
let prevDate = timestampToDate(prevTimeTimestamp)
let currentDate = timestampToDate(currentTimeTimestamp)
let nextDate = timestampToDate(nextTimeTimestamp)