简体   繁体   English

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

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

I am using the fullcalendar Ver 3.我正在使用 fullcalendar Ver 3。

the minTime is set to "7:00" . 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,
            });
        }

in the Month, Week, Day view when I want to enter a new event the time is set to 00:00在月、周、日视图中,当我想输入新事件时,时间设置为 00:00

在此处输入图片说明

I changed the selectedEvent in select section to我将 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
 };

But no success.但没有成功。 why the 7:00 (minTime) wouldn't affect the form ( which is obviously the start value)?为什么 7:00 (minTime) 不会影响表单(这显然是起始值)?

You have to do appropriate changes in the Form>"BookingType.php" file.您必须在 Form>"BookingType.php" 文件中进行适当的更改。

Particularly in the $builder.特别是在 $builder 中。

You may add for example:您可以添加例如:

'hours' => range(7,20), (to only be able to choose an hour between 7am and 8pm) 'hours' => range(7,20),(只能在早上 7 点到晚上 8 点之间选择一个小时)

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

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