FullCalendar有多个用户

时间:2017-02-11 13:54:26

标签: javascript ruby mongodb fullcalendar

我们目前使用Excel电子表格显示我们的5个成员管理团队的日程安排。这是一件非常容易的事情,因为我们只有三个班次:D =白班,E代表晚上,M代表午夜。单元格评论显示特定班次的任何特定活动。

现在是时候离开Excel进入一个更加动态的环境了,我想将FullCalendar与我的MongoDB和一些Ruby脚本一起使用。但是,我不是JS专家,我想知道是否可以在一个日历上查看所有5个时间表?也许每个经理名称旁边的复选框将显示其日历(如果选中),或者所有经理都显示所有已检查的环境类型。

我没有在文档上看到这种类型的功能,所以下一个最好的地方就是在这里询问专家!

非常感谢!!

1 个答案:

答案 0 :(得分:3)

enter image description here首先你需要全日历的调度程序加载项,你很高兴。 下面是一个例子

        var calendar = $('#calendar').fullCalendar({
                            schedulerLicenseKey: 'your key here',
                            header: {left: 'prev,next today', center: 'title', right: ''},
                            selectable: true,
                            defaultView: 'agendaDay',
                            ignoreTimezone: true,
                            allDayDefault: false,
                            unselectAuto: false,
                            editable: false,
                            slotLabelFormat:"HH:mm",
                            events: [   //the events example
            [
                id: 1,
                type: null,
                resourceIds: [
                    21
                ],
                title:"Meeting With John",
                start: 2017-02-13 09:00:00,
                end: 2017-02-13 11:20:00,
            ],
            [
                id: 2,
                type: null,
                resourceIds: [
                    22
                ],
                title: "Appointment With Doctor",
                start: 2017-02-13 10: 00: 00,
                end: 2017-02-13 13: 20: 00,
            ],
        ],

     resources: [ // these resources examples are the users you want to create(where its id is mapped to resourceIds in events JSON )
            [
                id: 21,
                title: "User A"
            ],
            [
                id: 22,
                title: "User B"
            ]
           ]

                        });


<div id="calendar" style="width:100% !important">

</div>

请参阅示例的快照。 让我知道它是如何运作的......