2017-02-11 32 views
1

我们目前使用Excel电子表格来显示5位会员管理团队的时间表。这是一件很容易的事情,因为我们只有三班倒:D =白班,E为晚上,M为午夜。单元格注释显示特定班次的任何特定活动。拥有多个用户的FullCalendar

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

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

非常感谢!

+0

是的,这是可能的!你可以使用fullcalendar的调度程序,并显示这些用户在同一时间安排所有 –

回答

1

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> 

查看示例的快照。 让我知道它是如何工作的...

+0

这看起来完全像我想要的!完成后我会通知你! – user2843365

+0

@ user2843365肯定的事情!乐意效劳!! –