使用 rrule 在 Fullcalendar 版本 6 中重复发生事件

问题描述 投票:0回答:1

我正在尝试使用 rrule 找出 fullcalendar 版本 6 中的重复事件,但它不起作用。我需要每周、每月和每年的特定日期执行重复事件。我无法弄清楚出了什么问题,也没有在控制台中显示任何错误。

  calendar = new Calendar(calendarEl, {
        // Event handlers
        eventClick: function(info) {
            var eventObj = info.event;
            populateAndShowModal(eventObj, eventObj.extendedProps.procedure);
        },
        eventReceive: function(info) {
            var eventObj = info.event;
            populateAndShowModal(eventObj, eventObj.title);
        },

        schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
        droppable: true,
        themeSystem: 'bootstrap5',
        displayEventTime: false,
        slotLabelInterval: {
            minutes: 30
        },
        slotMinTime: '08:00:00',
        slotMaxTime: '19:00:00',
        eventTimeFormat: {
            hour: '2-digit',
            minute: '2-digit',
            hour12: false,
        },
        height: "auto",
        initialView: 'resourceTimelineDay',
        aspectRatio: 1.5,
        headerToolbar: {
            left: 'prev,next,custom2',
            center: 'title',
            right: 'custom1,resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth'
        },
        editable: true,
        resourceAreaHeaderContent: 'Staff',
        resources: [{
            id: 6,
            title: "New",
        }, {
            id: 211,
            title: "Test",
        }],
        events: [{
            title: "SiH|97155|Processed|208|97155",
            duration: '39:00',
            resourceId: 211,
            assignedToName: "Matt Randall",
            procedure: "97155",
            color: "#00ffca",
            rrule: {
                freq: rrule.RRule.WEEKLY,
                interval: 2,
                byweekday: [rrule.RRule.WED],
                dtstart: '2024-03-13T08:00:00'
            }
        }]
    });
    calendar.render();

javascript fullcalendar rrule fullcalendar-6
1个回答
0
投票

我缺少连接完整日历和 rrule 插件的 js。它现在正在工作,因为我有这样的代码。

 calendar = new Calendar(calendarEl, {
    // Event handlers
    eventClick: function(info) {
        var eventObj = info.event;
        populateAndShowModal(eventObj, eventObj.extendedProps.procedure);
    },
    eventReceive: function(info) {
        var eventObj = info.event;
        populateAndShowModal(eventObj, eventObj.title);
    },

    schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
    droppable: true,
    themeSystem: 'bootstrap5',
    displayEventTime: false,
    slotLabelInterval: {
        minutes: 30
    },
    slotMinTime: '08:00:00',
    slotMaxTime: '19:00:00',
    eventTimeFormat: {
        hour: '2-digit',
        minute: '2-digit',
        hour12: false,
    },
    height: "auto",
    initialView: 'resourceTimelineDay',
    aspectRatio: 1.5,
    headerToolbar: {
        left: 'prev,next,custom2',
        center: 'title',
        right: 'custom1,resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth'
    },
    editable: true,
    resourceAreaHeaderContent: 'Staff',
    resources: [{
        id: 6,
        title: "New",
    }, {
        id: 211,
        title: "Test",
    }],
    events: [{
        title: "SiH|97155|Processed|208|97155",
        duration: '39:00',
        resourceId: 211,
        assignedToName: "Matt Randall",
        procedure: "97155",
        color: "#00ffca",
        rrule: {
            freq: "weekly",
            interval: 2,
            byweekday: ["mo"],
            dtstart: '2024-03-13T08:00:00'
        }
    }]
});
calendar.render();
© www.soinside.com 2019 - 2024. All rights reserved.