Fullcalendar v5 Last hour notshowing after set slotMaxTime dinamiclly

Viewed 1085

I am trying to add dinamiclly slotMinTime and slotMaxTime, after I do that last hour not showing. I saw in HTML its there but not showing. I try calendar.destroy and render but nothing...you can see on image. Here is my code.. Plesase help!!! Last our missing

dayCellContent: function (info) {
                if (info.view.type == "dayGridMonth") {
                    return;
                }
                else {
                    var mojdatum = calendar.getDate();
                    mojdatum = moment(mojdatum).format('YYYY-MM-DD');
                    var mojpocetak = moment(mojdatum).format('YYYY-MM-DD HH:mm');
         var mojkraj = moment(mojpocetak).add("23", "h").format('YYYY-MM-DD HH:mm');

                    $.ajax({
                        url: TimePath,
                        data: {
                            terminal: terminal,
                            start: mojpocetak,
                            end:mojkraj,
                            tip: kupac
                        },
                        success: function (data) {                               
                            calendar.setOption('slotMaxTime', data.max);
                            calendar.setOption('slotMinTime', data.min);                        
                           
                            return;
                        }
                    });
                    return;
                }

            },
1 Answers

What value did you set for maxSlotTime in the code which produced that screenshot?

As per the maxSlotTime documentation it's important to remember that the time you set is exclusive.

So if for example you set 16.30 as the max time, it will show just like your screenshot.

Why? Because the maxSlotTime is treated as the moment after the calendar slots end. So in reality this means your calendar would end at 16:29:59. Therefore 16.30 does not appear, because that's not part of the time period covered by the calendar.

Demo: https://codepen.io/ADyson82/pen/PoZaZzq

Related