如何定义要在Jquery完整日历上显示的列数?

时间:2014-10-02 15:24:00

标签: fullcalendar

我使用的是周视图,但是不是每张幻灯片显示7列我想显示三列,是否可以存档?

我在官方文档中没有看到任何相关方法:http://fullcalendar.io/docs/

2 个答案:

答案 0 :(得分:1)

完整日历2.2.5+版本内置了这种自定义功能。

你只需要这样做:

views: {
  agendaThreeDay: {
    type: 'agenda',
    duration: { days: 3 },
    buttonText: '3 day'
  },
  defaultView: 'agendaThreeDay'
}

您可以从文档页面here获取有关此内容的更多信息。

答案 1 :(得分:0)

拉动源代码,使用此代码(可能需要进行一些额外的更改)。

<强>的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

在此处查看如何构建:https://github.com/arshaw/fullcalendar/wiki/Contributing-Code