当前日期+1
var time1 =new Date(new Date().setDate(new Date().getDate()+1));
判断指定日期与当前日期的大小
'${day}'是后台传过来的 new Date();
var day = '${day}';
var time = new Date(Date.parse(day));
if(time>end_time){//截止日期 小于 当前日期 超期
return '<div style="background-color: #f4606c;">内容内容</div>';
}
本文介绍了一种使用JavaScript进行日期比较的方法,通过将当前日期与指定日期转换为Date对象并进行对比,实现日期大小的判断。这对于任务截止日期的监控、日程安排等功能非常实用。

被折叠的 条评论
为什么被折叠?



