3 function sendEventToForm(event) {
4 $('#starttimepicker').data("DateTimePicker").date(event.start);
5 $('#endtimepicker').data("DateTimePicker").date(event.end);
8 var calendarOptions = {
11 left: 'prev,next today',
13 right: 'agendaWeek,month'
15 timezone: user_timezone, // set in booking_calendar.html
17 slotDuration: '00:60:00',
18 slotLabelFormat: "HH:mm",
25 eventLimit: true, // allow "more" link when too many events
26 timeFormat: 'H(:mm)', // uppercase H for 24-hour clock
30 // selectHelper is only working in the agendaWeek view, this is a workaround:
31 // if an event is selected, the existing selection is removed and a temporary event is added
33 select: function (start, end) {
34 if (tmpevent != undefined) {
35 $('#calendar').fullCalendar('removeEvents', tmpevent.id);
36 $('#calendar').fullCalendar('rerenderEvents');
39 // the times need to be converted here to make them show up in the agendaWeek view if they
40 // are created in the month view. If they are not converted, the tmpevent will only show
41 // up in the (deactivated) allDaySlot
42 start = moment(start);
46 id: '537818f62bc63518ece15338fb86c8be',
53 $('#calendar').fullCalendar('renderEvent', tmpevent, true);
54 sendEventToForm(tmpevent);
57 eventClick: function (event) {
58 if (tmpevent != undefined) {
59 if (event.id != tmpevent.id) {
60 $('#calendar').fullCalendar('removeEvents', tmpevent.id);
61 $('#calendar').fullCalendar('rerenderEvents');
67 eventDrop: function (event) {
68 sendEventToForm(event);
71 eventResize: function (event) {
72 sendEventToForm(event);