大家好,欢迎来到IT知识分享网。
//日程安排
functiontimeTable(id){var inner = “
$(“#timmerDlg”).html(inner);
$(“#timmerDlg”).dialog(‘open’);var h = $(window).height()*0.6$(‘#calendar’).fullCalendar({
header: {
left:’today’,
center:’prevYear prev title next nextYear’,
right:’month,basicDay’},
firstDay:7,//周日作为每周第一天
height:h,
navLinks:true, //can click day/week names to navigate views
editable: false,
eventLimit:true, //allow “more” link when too many events
timeFormat: ‘H:mm’,
allDaySlot:false,
selectable:true,
selectHelper:true,
select:function( startDate, endDate, allDay, jsEvent, view){
$(‘#calendar’).fullCalendar( ‘select’, startDate, endDate, allDay )
},
eventMouseover:function(calEvent, jsEvent, view){var mydiv = document.createElement(“div”);
mydiv.setAttribute(“id”,”hint”);
mydiv.style.position=”absolute”;
mydiv.style.width=”240px”;
mydiv.style.display=”none”;
document.getElementById(“timmerDlg”).appendChild(mydiv);var myhint = document.getElementById(“hint”);
myhint.style.display= “block”;
myhint.style.left= (jsEvent.clientX-90)+”px”;
myhint.style.top= (jsEvent.clientY-40)+”px”;
myhint.style.color=”white”;
$(“#hint”).css(“z-index”,”99″);
$(“#hint”).css(“background-color”,”#B2B104″);
$(“#hint”).css(“padding-left”,”20px”);
$(“#hint”).css(“height”,”20px”);
$(“#hint”).css(“line-height”,”150%”);
myhint.innerHTML=calEvent.title
},
eventMouseout:function(calEvent, jsEvent, view){var myhint = document.getElementById(“hint”);
document.getElementById(“timmerDlg”).removeChild(myhint);
},
dayClick:function(date, allDay, jsEvent, view){
},
buttonText:{
today:’今日’,
month:’月’,
day:’日’},
monthNames:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
monthNamesShort:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
dayNames:[‘星期日’,’星期一’, ‘星期二’, ‘星期三’, ‘星期四’, ‘星期五’, ‘星期六’],
events:[]
});//因为fullCalendar的start和end的区间不包括end结束日期,所以获取到给定时间的下一天。
//获取给定时间的下一天 yyyy-MM-dd格式
functiongetNextDay(d){
d= newDate(d);
d= +d + 1000*60*60*24;
d= newDate(d);//return d;
//格式化
var yy=d.getFullYear();var mm=d.getMonth()+1;var dd=d.getDate();var nextday=yy+”-“;if (mm<10){nextday+=”0”}
nextday+=mm+”-“;if(dd<10){nextday+=”0”}
nextday+=dd;returnnextday;
}
$.ajax({
url :’/LiveManager/sg/querySgTimetableById’,
data:{“sgid”:id},
type :’post’,
dataType:’json’,
success :function(data) {var inner = “
$(“#timmerDlg”).html(inner);
$(“#timmerDlg”).dialog(‘open’);var h = $(window).height()*0.6dt=data.lists;if(dt!=null&&dt.length>0){var content =[];for(var i=0;i
content.push(
{
title:dt[i][2],//事件的标题
start:dt[i][0],//事件开始时间
end:getNextDay(dt[i][1]),//事件结束时间
color:’red’}
);
}
$(‘#calendar’).fullCalendar({
header: {
left:’today’,
center:’prevYear prev title next nextYear’,
right:’month,basicDay’},
firstDay:7,
height:h,
navLinks:true, //can click day/week names to navigate views
editable: false,
eventLimit:true, //allow “more” link when too many events
timeFormat: ‘H:mm’,
allDaySlot:false,
selectable:true,
selectHelper:true,
select:function( startDate, endDate, allDay, jsEvent, view){
$(‘#calendar’).fullCalendar( ‘select’, startDate, endDate, allDay )
},
eventMouseover:function(calEvent, jsEvent, view){var mydiv = document.createElement(“div”);
mydiv.setAttribute(“id”,”hint”);
mydiv.style.position=”absolute”;
mydiv.style.width=”240px”;
mydiv.style.display=”none”;
document.getElementById(“timmerDlg”).appendChild(mydiv);var myhint = document.getElementById(“hint”);
myhint.style.display= “block”;
myhint.style.left= (jsEvent.clientX-90)+”px”;
myhint.style.top= (jsEvent.clientY-40)+”px”;
myhint.style.color=”white”;
$(“#hint”).css(“z-index”,”99″);
$(“#hint”).css(“background-color”,”#B2B104″);
$(“#hint”).css(“padding-left”,”20px”);
$(“#hint”).css(“height”,”20px”);
$(“#hint”).css(“line-height”,”150%”);
myhint.innerHTML=calEvent.title
},
eventMouseout:function(calEvent, jsEvent, view){var myhint = document.getElementById(“hint”);
document.getElementById(“timmerDlg”).removeChild(myhint);
},
dayClick:function(date, allDay, jsEvent, view){
},
buttonText:{
today:’今日’,
month:’月’,
day:’日’},
monthNames:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
monthNamesShort:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
dayNames:[‘星期日’,’星期一’, ‘星期二’, ‘星期三’, ‘星期四’, ‘星期五’, ‘星期六’],
events:content
});
clearSelections();
}else{
$(‘#calendar’).fullCalendar({
header: {
left:’today’,
center:’prevYear prev title next nextYear’,
right:’month,basicDay’},
firstDay:7,
height:h,
navLinks:true, //can click day/week names to navigate views
editable: false,
eventLimit:true, //allow “more” link when too many events
timeFormat: ‘H:mm’,
allDaySlot:false,
selectable:true,
selectHelper:true,
select:function( startDate, endDate, allDay, jsEvent, view){
$(‘#calendar’).fullCalendar( ‘select’, startDate, endDate, allDay )
},
eventMouseover:function(calEvent, jsEvent, view){var mydiv = document.createElement(“div”);
mydiv.setAttribute(“id”,”hint”);
mydiv.style.position=”absolute”;
mydiv.style.width=”240px”;
mydiv.style.display=”none”;
document.getElementById(“timmerDlg”).appendChild(mydiv);var myhint = document.getElementById(“hint”);
myhint.style.display= “block”;
myhint.style.left= (jsEvent.clientX-90)+”px”;
myhint.style.top= (jsEvent.clientY-40)+”px”;
myhint.style.color=”white”;
$(“#hint”).css(“z-index”,”99″);
$(“#hint”).css(“background-color”,”#B2B104″);
$(“#hint”).css(“padding-left”,”20px”);
$(“#hint”).css(“height”,”20px”);
$(“#hint”).css(“line-height”,”150%”);
myhint.innerHTML=calEvent.title
},
eventMouseout:function(calEvent, jsEvent, view){var myhint = document.getElementById(“hint”);
document.getElementById(“timmerDlg”).removeChild(myhint);
},
dayClick:function(date, allDay, jsEvent, view){
},
buttonText:{
today:’今日’,
month:’月’,
day:’日’},
monthNames:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
monthNamesShort:[‘1月’, ‘2月’, ‘3月’, ‘4月’, ‘5月’, ‘6月’, ‘7月’, ‘8月’, ‘9月’, ’10月’, ’11月’, ’12月’],
dayNames:[‘星期日’,’星期一’, ‘星期二’, ‘星期三’, ‘星期四’, ‘星期五’, ‘星期六’],
events:[]
});
clearSelections();
}
}
});
}
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/20922.html