Fullcalendar.io - businessHours-per-resource未显示

时间:2018-04-03 11:30:46

标签: javascript html fullcalendar fullcalendar-scheduler

我使用fullcalendar,我需要显示不同的营业时间(开放时间)资源。我的实际解决方案是:

$('#calendar').fullCalendar({
  defaultView: 'agendaDay',
  locale: 'cs',
  slotDuration: '00:15:00',
  scrollTime: scrollTime,
  timeFormat: 'hh:mm',
  slotLabelFormat:"HH:mm",
  editable: true,
  droppable: true,
  selectable: true,
  eventLimit: true,
  businessHours: true,
  header: {
    left: 'prev,next today',
    center: 'title',
    right: 'agendaDay,agendaTwoDay,agendaWeek,month'
  },
  views: {
    agendaTwoDay: {
      type: 'agenda',
      duration: { days: 2 },
      groupByResource: false,
    }
  },
  resources: [
    {
     id:4,
     title: "Employee 1",
     businessHours: { dow: [ 0, 1, 2, 3, 4, 5, 6 ],
       start:"08:00:00", end:"12:00:00"
     }
    },
    {
     id:5,
     title: "Employee 2"
    }
  ],
  events: function(start, end, timezone, callback) {
    $.nette.ajax({
      url: 'data',
      dataType: 'xml',
      data: {
        start: start.unix(),
        end: end.unix()
      },
      success: function(doc) {
        var events = [];

        $(doc).find('event').each(function() {
          events.push({
            id: $(this).attr('id'),
            resourceId: $(this).attr('resourceId'),
            title: $(this).attr('example'),
            description: $(this).attr('description'),
            start: $(this).attr('start'),
            end: $(this).attr('end'),
            color: $(this).attr('color'),
            className: 'formModal',
          });
        });
        callback(events);
      }
    });
  }
});

但是在日历中我没有看到商务时间。如果我查看源代码,我会看到元素但有高度:0px;

你能告诉我哪里有问题吗?我如何在一周的不同日子为一种资源设置不同的工作时间?

谢谢,

0 个答案:

没有答案