科研动态
research
更多
学术日历
lecture
更多
Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
\n' +
'
' +
'
';
}
$("#calendarnews").html(html);
swiperInit();
});
},
initcalendar: function (signList) {
var dayJson = ret;
var html = '';
var html1 = '';
for (var i = 0; i < dayJson.length; i++) {
var sdate = dayJson[i].sdate == undefined ? '' : dayJson[i].sdate;
var edate = dayJson[i].edate == undefined ? '' : dayJson[i].edate;
var url = dayJson[i].url == undefined ? '' : dayJson[i].url;
var title = dayJson[i].title == undefined ? '' : dayJson[i].title;
var people = '';
var addr = '';
var sj = '';
if (dayJson[i].fields!=undefined&&dayJson[i].fields.zjr!=undefined) people = dayJson[i].fields.zjr;
if (dayJson[i].fields!=undefined&&dayJson[i].fields.dd!=undefined) addr = dayJson[i].fields.dd;
if (dayJson[i].fields!=undefined&&dayJson[i].fields.sj!=undefined) sj = dayJson[i].fields.sj;
var treeid=dayJson[i].treeid == undefined ? '' : dayJson[i].treeid;
var treeName="";
if(treeid=='1691'){
treeName="学术讲座";
}else{
treeName="学术会议";
}
if(sdate == calUtil.curDate&&edate >= calUtil.curDate) {
html+=
'
\n' +
'
'+treeName+'
\n' +
'
' +
'
';
}
if(sdate > calUtil.curDate&&edate > calUtil.curDate) {
html1+=
'
\n' +
'
'+treeName+'
\n' +
'
' +
'
';
}
}
if (html==''){
$("#calendarnews").html(html1);
}else {
$("#calendarnews").html(html);
}
},
//日历时间的下拉选择
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].sdate == 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([{"sdate": ""}]);
function getJson(year, date) {
calUtil.init(ret);
}
getJson(calUtil.showYear, (calUtil.showMonth<10?'0'+calUtil.showMonth:calUtil.showMonth));
function swiperInit() {
JVzpYHV2 = new Swiper(".cslide", {
autoplay: { delay: 6000, stopOnLastSlide: !1, disableOnInteraction: !1 }, //当天几条数据自动滚动
effect : 'fade',
fadeEffect: {
crossFade: true,
},
navigation: { nextEl: ".cslide .next", prevEl: ".cslide .prev" },
pagination: {
el: '.cslide .dots',
clickable: true,
bulletActiveClass: 'active',
type: 'fraction',
renderFraction: function (currentClass, totalClass) {
return '
';
},
},
observer:true,
observeParents:true,
});
JVzpYHV2.slideTo(0);
$(".day-this").removeClass("calendar-this");
$(this).addClass("calendar-this");
}
swiperInit();
if( $("#calendarnews").html() === "" ){
$(".sbtn").css("opacity","0")
}
});