2

Trying to use the fullcalendar plugin (V3).

That's what I have for now:

var calendar = $('#calendar').fullCalendar({
        themeButtonIcons: {
            prev: '<i class="fa fa-angle-left"></i>',
            next: '<i class="fa fa-angle-right"></i>'
        },
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        forceEventDuration: true,
        defaultTimedEventDuration: '00:30:00',
        defaultEventDuration: '00:30:00',
        eventDurationEditable: false,
        editable: false,
        selectable: true,
        selectHelper: true,
        dayClick: function(date, jsEvent, view) {
            if(view.name == 'month' || view.name == 'basicWeek') {
              $('#calendar').fullCalendar('changeView', 'agendaDay');
              $('#calendar').fullCalendar('gotoDate', date);
            }
        },

        select: function(start, end, jsEvent) {

            $("#calendar").fullCalendar('renderEvent', {
                title: 'eventTitle',
                start: start,
                end: end,
                stick: true
            });
        },
    });

The question is: why can't I make a fixed event duration? I am still able to drag the created event for any duration, but I need it to be exactly 30 minutes long.

Really waiting for your help. Thanks in advance!

Umutambyi Gad
  • 4,082
  • 3
  • 18
  • 39
Max Krizh
  • 585
  • 3
  • 7
  • 34
  • Can you provide a minimal reproducible working example please ? – Always Helping Aug 01 '20 at 18:27
  • @AlwaysHelping, done! Updated the question cause found some bug that solved first 2 problems. – Max Krizh Aug 01 '20 at 18:33
  • "I am still able to drag the created event for any duration"...do you mean during the "select" process? You can implement rules via the [selectAllow](https://fullcalendar.io/docs/v3/selectAllow) option to restrict that. – ADyson Aug 01 '20 at 20:55

0 Answers0