一直在寻找一种只显示本周和下个月在
FullCalendar的月份视图的方式.到目前为止,它似乎被建议作为即将到来的版本的功能,但在此期间,任何人都能够它在?
UPDATE
感谢Doomsday的建议,我可以创建一个自定义视图,显示从本周开始的2周.您正在将可见的开始日期更改为今天的日期,并将行数更改为2.
function TwoWeeksView(element,calendar) { var t = this; // exports t.render = render; // imports BasicView.call(t,element,calendar,'month'); var opt = t.opt; var renderBasic = t.renderBasic; var formatDate = calendar.formatDate; function render(date,delta) { if (delta) { addMonths(date,delta); date.setDate(1); } var start = cloneDate(date,true); start.setDate(1); var end = addMonths(cloneDate(start),1); //var visStart = cloneDate(start); var visStart = date; var visEnd = cloneDate(end); var firstDay = opt('firstDay'); var nwe = opt('weekends') ? 0 : 1; if (nwe) { skipWeekend(visStart); skipWeekend(visEnd,-1,true); } addDays(visStart,-((visStart.getDay() - Math.max(firstDay,nwe) + 7) % 7)); addDays(visEnd,(7 - visEnd.getDay() + Math.max(firstDay,nwe)) % 7); var rowCnt = Math.round((visEnd - visStart) / (DAY_MS * 7)); if (opt('weekMode') == 'fixed') { addDays(visEnd,(6 - rowCnt) * 7); //rowCnt = 6; rowCnt = 2; } t.title = formatDate(start,opt('titleFormat')); t.start = start; t.end = end; t.visStart = visStart; t.visEnd = visEnd; renderBasic(6,rowCnt,nwe ? 5 : 7,true); } }