0
嗨我想通过在页面中插入三个日历webparts并通过在CEWP中插入下面的代码来开发三个月滚动日历视图。SharePoint 2010滚动三个月日历
日历应分别滚动到上一个或下一个,但单击按钮'PrevMonth'和'NextMonth'。
它似乎只是滚动的工作,但有些事情是错误的。有人可以帮我弄这个吗 ?
< script type = "text/javascript" >
$(document).ready(function() {
window.setTimeout(setCal, 1000);
});
var CurrentDate = new Date();
function setCal() {
$("#PrevMonth").click(PrevMonth);
$("#NextMonth").click(NextMonth);
MoveToDate((CurrentDate.getMonth() + 2).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3');
MoveToDate((CurrentDate.getMonth() + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2');
MoveToDate((CurrentDate.getMonth()).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1');
}
function PrevMonth() {
MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3');
MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2');
MoveToDate((CurrentDate.getMonth() - 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1');
}
function NextMonth() {
MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ3');
MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ2');
MoveToDate((currentMonth + 1).toString() + '\u002f' + CurrentDate.getDate().toString() + '\u002f' + CurrentDate.getFullYear().toString(), 'WPQ1');
}
<
/script>