2017-02-11 30 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肯定的事情!樂意效勞!! –