MrShi
2024-02-23 1e72942aa4848ae4835e7f30bb4adc01f9ce5bdc
company/src/utils/util.js
@@ -75,3 +75,24 @@
  let day = currentDate.getDate(); // 获取当前日期
  return `${year}-${month}-${day}`
}
// 对比日期
export function compareDates(date1, date2) {
  if (new Date(date1).getTime() > new Date(date2).getTime()) {
    return 1
  } else if (new Date(date1).getTime() < new Date(date2).getTime()) {
    return 2
  } else {
    return 3
  }
}
// 获取明天的日期
export function getTomorrow() {
  var today = new Date();
  today.setDate(today.getDate() + 1);
  var year = today.getFullYear();
  var month = today.getMonth() + 1;
  var day = today.getDate();
  return year + "-" + month + "-" + day;
}