Fullcalendar 如何定义要在Jquery完整日历上显示的列数?
我使用的是week视图,但不是每张幻灯片显示7列,而是要显示三列,是否可以存档Fullcalendar 如何定义要在Jquery完整日历上显示的列数?,fullcalendar,Fullcalendar,我使用的是week视图,但不是每张幻灯片显示7列,而是要显示三列,是否可以存档 我在官方文档中没有看到任何相关方法:获取源代码,使用此代码(可能需要一些额外的更改) src/AgendaThreeDayView.js fcViews.agendaThreeDay = AgendaThreeDayView; function AgendaThreeDayView(a) { AgendaView.call(this, a); } AgendaThreeDayView.prototype
我在官方文档中没有看到任何相关方法:获取源代码,使用此代码(可能需要一些额外的更改) src/AgendaThreeDayView.js
fcViews.agendaThreeDay = AgendaThreeDayView;
function AgendaThreeDayView(a) {
AgendaView.call(this, a);
}
AgendaThreeDayView.prototype = createObject(AgendaView.prototype);
$.extend(AgendaThreeDayView.prototype, {
name: "agendaThreeDay",
incrementDate: function(a, b) {
return a.clone().stripTime().add(b, "days");
},
render: function(a) {
this.intervalStart = a.clone().stripTime();
this.intervalEnd = this.intervalStart.clone().add(3, "days");
this.start = this.skipHiddenDays(this.intervalStart);
this.end = this.skipHiddenDays(this.intervalEnd, -1, true);
this.title = this.calendar.formatRange(this.start, this.end.clone().subtract(1), this.opt("titleFormat"), " — ");
AgendaView.prototype.render.call(this, 3);
}
});
编辑:
记住,您需要将文件添加到lumbar.json
在这里查看如何构建:完整日历的2.2.5+版内置了这种定制功能 您只需执行以下操作:
views: {
agendaThreeDay: {
type: 'agenda',
duration: { days: 3 },
buttonText: '3 day'
},
defaultView: 'agendaThreeDay'
}
您可以从“文档”页面获取更多信息