0

我有 fullcalendar v2 和 Laravel 应用程序。几乎所有事情都是用数据库和其他东西完成的,但最后一件事是缺失的。我不太擅长 JS,需要有人帮助。

我有这个脚本,它适用于显示约会和资源

      $(document).ready(function () {
      var events ={!! json_encode($events) !!};
      var resources ={!! json_encode($resources) !!};
      $('#calendar').fullCalendar({
        defaultView: 'agendaDay',
        defaultDate: moment().format("YYYY-MM-DD"),
        timeFormat : 'HH:mm',
        editable: true,
        height: 1150,
        eventLimit: true, // allow "more" link when too many events
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'agendaDay,agendaTwoDay,agendaWeek,month'
        },
        views: {
            agendaTwoDay: {
                type: 'agenda',
                duration: { days: 2 },

                // views that are more than a day will NOT do this behavior by default
                // so, we need to explicitly enable it
                groupByResource: true

                //// uncomment this line to group by day FIRST with resources underneath
                //groupByDateAndResource: true
            }
        },

        //// uncomment this line to hide the all-day slot
        allDaySlot: false,
        slotLabelFormat:"HH:mm",
        hiddenDays: [0],
        minTime:"07:00:00",
        maxTime: "23:59:59",
        slotDuration:"00:15:00",

        resources: resources,
        events: events,

        selectable: true,
        initialView: 'resourceTimelineWeek',
        headerToolbar: {
            left: 'prev,next today',
            center: 'title',
            right: 'resourceTimelineWeek,timeGridDay'
        },
        select: function(startDate, endDate, jsEvent, view, resource) {
            alert('selected ' + startDate.format() + ' to ' + endDate.format() + ' on resource ' + resource.id);
        }
    });
  })

我需要在这里选择空闲时间,我的应用程序打开 create-appointment.blade.php 并解析资源 startDatetime 和 endDatetime

4

0 回答 0