var nowDay = d == 0 ? nowDate.getDate() : d; $(".selectYear").html(nowYear + "年"); $(".selectMonth").html(nowMonth + "月"); var nowDaysNub = this.CalculateMonthDays(nowMonth, nowYear); //获取当月第一天是星期几 //var weekDate = new Date(nowYear+"-"+nowMonth+"-"+1); //alert(weekDate.getDay()); var nowWeek = parseInt(this.CalculateWeek(nowYear, nowMonth, 1)); //nowWeek=weekDate.getDay()==0?7:weekDate.getDay(); //var nowWeek=weekDate.getDay(); //获取上个月的天数 var lastMonthDaysNub = this.CalculateMonthDays((nowMonth - 1), nowYear); if (nowWeek != 0) { //生成上月剩下的日期 for (var i = (lastMonthDaysNub - (nowWeek - 1)); i < lastMonthDaysNub; i++) { $dayItem.append("
" + (i + 1) + "
"); } } //生成当月的日期 for (var i = 0; i < nowDaysNub; i++) { if (i == (nowDay - 1)) $dayItem.append("
" + (i + 1) + "
"); else $dayItem.append("
" + (i + 1) + "
"); } //获取总共已经生成的天数 var hasCreateDaysNub = nowWeek + nowDaysNub; //如果小于42,往下个月推算 if (hasCreateDaysNub < 42) { for (var i = 0; i <= (42 - hasCreateDaysNub); i++) { $dayItem.append("
" + (i + 1) + "
"); } } return $dayItem; }, CSS: function () { var itemPaddintTop = $(".dayItem").height() / 6; $(".item").css({ "width": $(".week").width() / 7 + "px", "line-height": itemPaddintTop + "px", "height": itemPaddintTop + "px" }); $(".currentItem>a").css("margin-left", ($(".item").width() - 25) / 2 + "px").css("margin-top", ($(".item").height() - 25) / 2 + "px"); }, CalculateNextMonthDays: function () { if (this.isRunning == false) { $(".currentDay").show(); var m = this.currentMonth == 12 ? 1 : this.currentMonth + 1; var y = this.currentMonth == 12 ? (this.currentYear + 1) : this.currentYear; var d = 0; var nowDate = new Date(); if (y == nowDate.getFullYear() && m == nowDate.getMonth() + 1) d = nowDate.getDate(); else d = 1; $calendarItem = this.CreateCalendar(y, m, d); $("#Container").append($calendarItem); this.CSS(); this.isRunning = true; $($("#Container").find(".dayItem")[0]).animate({ height: "0px" }, 300, function () { $(this).remove(); CalendarHandler.isRunning = false; }); } }, CalculateLastMonthDays: function () { if (this.isRunning == false) { $(".currentDay").show(); var nowDate = new Date(); var m = this.currentMonth == 1 ? 12 : this.currentMonth - 1; var y = this.currentMonth == 1 ? (this.currentYear - 1) : this.currentYear; var d = 0; if (y == nowDate.getFullYear() && m == nowDate.getMonth() + 1) d = nowDate.getDate(); else d = 1; $calendarItem = this.CreateCalendar(y, m, d); $("#Container").append($calendarItem); var itemPaddintTop = $(".dayItem").height() / 6; this.CSS(); this.isRunning = true; $($("#Container").find(".dayItem")[0]).animate({ height: "0px" }, 300, function () { $(this).remove(); CalendarHandler.isRunning = false; }); } }, CreateCurrentCalendar: function () { if (this.isRunning == false) { $(".currentDay").hide(); $calendarItem = this.CreateCalendar(0, 0, 0); $("#Container").append($calendarItem); this.isRunning = true; $($("#Container").find(".dayItem")[0]).animate({ height: "0px" }, 300, function () { $(this).remove(); CalendarHandler.isRunning = false; }); this.CSS(); $("#centerMain").animate({ marginLeft: -$("#center").width() + "px" }, 500); } }, RunningTime: function () { var mTiming = setInterval(function () { var nowDate = new Date(); var h = nowDate.getHours() < 10 ? "0" + nowDate.getHours() : nowDate.getHours(); var m = nowDate.getMinutes() < 10 ? "0" + nowDate.getMinutes() : nowDate.getMinutes(); var s = nowDate.getSeconds() < 10 ? "0" + nowDate.getSeconds() : nowDate.getSeconds(); var nowTime = h + ":" + m + ":" + s; $("#footNow").html("本地时间 " + nowTime); }, 1000); } }

纪委信箱

院长信箱

本科招生网