繁体   English   中英

StartTime 在 FUllcalendar 的周、月、日视图中不会改变

[英]StartTime doesn't change in week , Month,Day view of FUllcalendar

我正在使用 fullcalendar Ver 3。

minTime设置为"7:00"

  $('#calender').fullCalendar({
                locale: 'it',
                slotDuration: '00:15:00',
                minTime: '07:00:00',
                defaultView: 'agenda',
                defaultTimedEventDuration: '00:15:00',
                contentHeight: 600,
                defaultDate: new Date(),
                timeFormat: 'h(:mm)a',
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,basicWeek,basicDay,agenda'
                },
                eventLimit: true,
                eventColor: '#378006',
                events: events,

               
                eventClick: function (calEvent, jsEvent, view) {
                    selectedEvent = calEvent;
                    $('#myModal #eventTitle').html(calEvent.lastName + ' ' + calEvent.firstName + '<br>' + calEvent.phone);
                    var $description = $('<div/>');
                    $description.append($('<p/>').html('<b>Start:</b>' + calEvent.start.format("DD-MMM-YYYY HH:mm a")));
                    if (calEvent.end != null) {
                        $description.append($('<p/>').html('<b>End:</b>' + calEvent.end.format("DD-MMM-YYYY HH:mm a")));
                    }
                    $description.append($('<p/>').html('<b>Description:</b>' + calEvent.description));
                    $('#myModal #pDetails').empty().html($description);

                    $('#myModal').modal();
                },
                selectable: true,

                select: function (start, end) {
                    $('#hdEventID').val(0);
                    $('#txtFirstName').val('');
                    $('#txtLastName').val('');
                    $("#txtCustomerId").val(0);
                    $("#txtPhone").val('');
                    selectedEvent = {
                        eventID: 0,
                        fullName: '',
                        lastName: '',
                        firstName: '',
                        description: '',
                        allDay: false,
                        start: start,
                        end: end,
                        color: '',
                        Custd: 0
                    };                        
                    modaltest();
                    openAddEditForm();                                              
                },
                editable: true,
            });
        }

在月、周、日视图中,当我想输入新事件时,时间设置为 00:00

在此处输入图片说明

我将 select 部分中的 selectedEvent 更改为

start = start.add(moment.duration("07:00:00")).format('DD/MM/YYYY HH:mm A');
selectedEvent = {
      eventID: 0,
      fullName: '',
      lastName: '',
      firstName: '',
      description: '',
      allDay: false,
      start: start,
      end: end,
      color: '',
      Custd: 0
 };

但没有成功。 为什么 7:00 (minTime) 不会影响表单(这显然是起始值)?

您必须在 Form>"BookingType.php" 文件中进行适当的更改。

特别是在 $builder 中。

您可以添加例如:

'hours' => range(7,20),(只能在早上 7 点到晚上 8 点之间选择一个小时)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM