代码不长: var today=new Date();var weekday=today.getDay(); var monday=new Date(1000*60*60*24*(1-weekday) + today.getTime()); var friday=new Date(1000*60*60*24*(5-weekday) + today.getTime()); 目前monday和friday都是Date类型的,要得到字符串类型,可以考虑下面的函数: function get…
1.假期实体类: package com.smics.date; import java.io.Serializable; import java.util.Date; public class Vacation implements Serializable { private static final long serialVersionUID = 1L; private Date date; private int days; public Date getDate() { return…
//两个时间相差天数 兼容firefox chrome var days = function(startDate) { var sdate = new Date(startDate.replace(/-/g, "/")); var now = new Date(); var days = now.getTime() - sdate.getTime(); var day = parseInt(days / (1000 * 60 * 60 * 24)); return day; …