Is it possible to resize the temp event added with selectMirror in FullCalendar v5.7.2?

Viewed 60

I managed to get a temporary event making use of selectMirror in FullCalendar v5.7.2.

I was wondering if there is a way to dynamically resize this event based on user preference. I tried to access the last element of the calendar.getEvents() but this returned an already validated event.

Any feedback would be very useful for this. Thanks!

1 Answers

I managed to get a temporary event

...it's not really a temporary event, it's just showing you the currently selected area in a more emphatic way than the default display. (The documentation calls it a "placeholder event" but that's a bit of a misnomer really compared to its actual functionality.) Therefore none of the event-related functions are any use to you here.

The easiest way to resize it is simply for the user to go back and drag again to select a different area. However if you want to do it programmatically based on some other input from the user (e.g. via a separate datepicker control, or something like that) then you can use the select() function to change the current selection, e.g.

calendar.select(start, end)

where start and end are valid Date objects or date-parseable strings.

More info: https://fullcalendar.io/docs/Calendar-select

Related