export function compareDate(currentTime, sportsTime) {
let curTimeBegin = new Date(currentTime[0]);
let curTimeEnd = new Date(currentTime[1]);
let sprTimeBegin = new Date(sportsTime[0]);
let sprTimeEnd = new Date(sportsTime[1]);
if (curTimeBegin >= sprTimeBegin && curTimeEnd <= sprTimeEnd) {
return true;
}
return false;
}
export function isDuringDate(curDate, beginDateStr, endDateStr) {
(curDate = new Date(curDate)((beginDate = new Date(beginDateStr)))),
(endDate = new Date(endDateStr));
if (curDate >= beginDate && curDate <= endDate) {
return true;
}
return false;
}
js 判断当前日期时间是否处于某个日期范围
最新推荐文章于 2024-05-15 16:06:03 发布