javascript - 具有多个用户的 FullCalendar

标签 javascript ruby mongodb fullcalendar

我们目前使用 Excel 电子表格来显示我们的 5 人管理团队的日程安排。这很容易做到,因为我们只有三个轮类:D = 白类,E 代表晚上,M 代表午夜。单元格注释显示特定类次的任何特定事件。

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

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

非常感谢!!

最佳答案

enter image description here首先,您需要 fullcalendar 的调度程序插件,一切顺利。 这是一个例子

        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>

请参阅示例快照。 让我知道结果如何...

关于javascript - 具有多个用户的 FullCalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42176674/

相关文章:

java - 如果使用不同的方法连接,为什么 Mongo 不抛出异常?

javascript - 如何从下拉列表中隐藏已选择的值?

javascript - 我们可以将游标设置为 session 变量吗?

ruby-on-rails - named_scope 的问题导致 will_paginate 出错 - 如何将 group_by 包含在计数中?

ruby - 在启动时加载上帝脚本 - 需要全局 gem ?

javascript - 用下划线或其他东西组合 2 个 MongoDB 集合对象?

javascript - 在 mongoDB 中获取错误未知组运算符 '$group'

javascript - 提交时清除默认搜索文本

javascript - 获取在 Node/Express 中传递不同数据的相同 URL 的方法

ruby-on-rails - rails "undefined method for ActiveRecord_Associations_CollectionProxy"