dateUtils.js 595 B

1234567891011121314151617181920
  1. /**
  2. * 检查当前时间是否在7月28号零点之后
  3. * @returns {boolean} 如果在7月28号零点之后返回true,否则返回false
  4. */
  5. export function isAfterJuly28() {
  6. const now = new Date();
  7. const july28 = new Date(2025, 6, 28, 0, 0, 0); // 月份从0开始,所以7月是6
  8. return now >= july28;
  9. }
  10. /**
  11. * 检查当前时间是否在指定日期之后
  12. * @param {Date} targetDate 目标日期
  13. * @returns {boolean} 如果在目标日期之后返回true,否则返回false
  14. */
  15. export function isAfterDate(targetDate) {
  16. const now = new Date();
  17. return now >= targetDate;
  18. }