1. const intervalDay = dayjs(this.queryDate.endTime).diff( this.queryDate.beginTime, "day" ); if (intervalDay > 2) { return this.$message.warning("日期间隔不能大于3天"); } 1. 2. 3. 4. 5. 6. 7.
//计算天数 $timediff = $endtime-$starttime; $days = intval($timediff/86400); //计算小时数 $remain = $timediff%86400; $hours = intval($remain/3600); //计算分钟数 $remain = $remain%3600; $mins = intval($remain/60); //计算秒数 $secs = $remain%60; $res = array("day" => $d...