问题描述
我正在使用全日历版本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
我将选择部分中的selectedEvent更改为
start = start.add(moment.duration("07:00:00")).format('DD/MM/YYYY HH:mm A');
selectedEvent = {
eventID: 0,Custd: 0
};
但是没有成功。为什么7:00(最小时间)不会影响表单(显然是起始值)?
解决方法
您必须在Form>“ BookingType.php”文件中进行适当的更改。
尤其是在$ builder中。
您可以添加例如:
'hours'=> range(7,20),(只能在上午7点至晚上8点之间选择一个小时)