import dayjs from 'dayjs' //时间格式库 import infoBox from '@/commons/utils/infoBox.js' // 时间校验 用于筛选 开始 时间不能大于结束 开始结束时间必选 时间 返回值 true 和 false export const startAndEndTime = (start, end) => { if (!start || !end) { infoBox.showToast('请选择开始或结束时间') return false } if (dayjs(start).isAfter(end)) { infoBox.showToast('开始时间不能大于结束时间') return false } return true }