-
2024-07-02 15:00-16:30
-
2024-07-01 15:30-17:00
-
2024-06-27 14:00-15:30
-
2024-06-27 14:00-15:30
-
2024-06-26 15:00-17:00
2024-07-01 15:30-17:00
李华楼B431
-
学术日历
-
\n' +
'
\n' +
'
\n' +
'
'+time+' '+hours+'
\n' +
'
'+addr+'
\n' +
'
' +
'
';
}
$("#calendarnews").html(html);
swiperInit();
});
},
//日历时间的下拉选择
setTimeHeadList: function(){
var html = '';
for (var i = -5; i < 6; i++) {
var varYear,varMonth;
if( calUtil.showMonth + i>12) {
varYear = calUtil.showYear + 1;
varMonth = calUtil.showMonth + i - 12;
}else if(calUtil.showMonth + i<1){
varYear = calUtil.showYear - 1;
varMonth = calUtil.showMonth + i + 12;
}else{
varYear = calUtil.showYear;
varMonth = calUtil.showMonth + i ;
}
html += '
' + varYear + '年' + varMonth + '月';
}
return html;
},
dateInit: function(num){
return (num < 10 ? '0' : '') + num;
},
//获取当前选择的年月
setMonthAndDay: function () {
switch (calUtil.eventName) {
case "load":
var current = new Date();
calUtil.showYear = current.getFullYear();
calUtil.showMonth = current.getMonth() + 1;
calUtil.curDay = current.getDate();
calUtil.curDate = calUtil.showYear + '-' + calUtil.dateInit(calUtil.showMonth) + '-' + calUtil.dateInit(calUtil.curDay);
break;
case "current":
break;
}
},
bulidCal: function (iYear, iMonth) {
var aMonth = new Array();
aMonth[0] = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
var iDayOfFirst = new Date(iYear, iMonth - 1, 1).getDay();
var iDaysInMonth = new Date(iMonth, iMonth, 0).getDate();
var iVarDate = 1;
for (var w = 1, d = iDayOfFirst ; w < 7 && iVarDate <= iDaysInMonth; w++,d = 0) {
aMonth[w] = new Array(7);
for (; d < aMonth[w].length; d++) {
if (iVarDate <= iDaysInMonth) {
aMonth[w][d] = iVarDate;
iVarDate++;
}
}
}
return aMonth;
},
ifHasSigned: function (signList, day) {
var boo = false;
for (var i = 0; i < signList.length; i++) {
if (signList[i].date == day) {
boo = true;
if(calUtil.map[day]==undefined)calUtil.map[day] = [];
calUtil.map[day].push(signList[i]);
}
}
return boo;
},
drawCal: function (iYear, iMonth, signList) {
var myMonth = calUtil.bulidCal(iYear, iMonth);
var htmls = new Array();
var curTime = "";
htmls.push("
");
for (var i = 0; i < myMonth[0].length; i++) htmls.push("" + myMonth[0][i] + " | ");
htmls.push("");
htmls.push("
");
var srtYearMonth = iYear + '-' + calUtil.dateInit(iMonth);
for (var w = 1; w < myMonth.length; w ++) {
htmls.push("");
for (var d = 0; d < 7; d++) {
if(myMonth[w][d]==undefined){
htmls.push(" | ");
}else{
var ifHasSigned = calUtil.ifHasSigned(signList, srtYearMonth + '-' + calUtil.dateInit(myMonth[w][d]));
var tdClass = '';
//是当天时间
var time = srtYearMonth + '-' + calUtil.dateInit(myMonth[w][d]);
if(time == calUtil.curDate)tdClass+=' calendar-this ';
if(ifHasSigned)tdClass+=' calendar-has ';
htmls.push(''+myMonth[w][d]+' | ');
}
}
htmls.push("
");
}
htmls.push("");
return htmls.join('');
}
};
calUtil.init([{"date": ""}]);
function getJson(year, date) {
$.ajax({
url: "newsdata/1033652/"+year+"-"+date+".js?r="+Math.random(),
type: "get",
dataType: "json",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
success: function (data) {
calUtil.init(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
},
complete: function (XMLHttpRequest, textStatus) {
this;
}
});
}
getJson(calUtil.showYear, (calUtil.showMonth<10?'0'+calUtil.showMonth:calUtil.showMonth));
function swiperInit() {
JVzpYHV2 = new Swiper(".cslide", {
speed: 800, spaceBetween: 0,
autoplay: { delay: 5E3, stopOnLastSlide: !1, disableOnInteraction: !1 }, //当天几条数据自动滚动
navigation: { nextEl: ".cslide .next", prevEl: ".cslide .prev" },
observer:true,
observeParents:true,
});
JVzpYHV2.slideTo(0);
$(".day-this").removeClass("calendar-this");
$(this).addClass("calendar-this");
}
swiperInit();