Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fullcalendar time interval

Tags:

fullcalendar

I'm using Fullcalendar to show events in my application, but I would also like to use it to schedule resources, but I need to be able to schedule those resources in 5 minute intervals. Can the calendar (week/day view) be configured to render 5 minute timeslots instead of the default 30 minute intervals?

If so, can dragging also be configured at the same interval?

like image 894
SomethingOn Avatar asked Nov 28 '22 07:11

SomethingOn


1 Answers

In the version 2.3.2 (I didn't check the previous versions) you can do the following:

slotDuration: '00:30:00',
snapDuration: '00:05:00',

The slotDuration changes the grid display to 30 minutes. The snapDuration is more interesting: it changes the start and end times in intervals of 5 minutes while you're dragging the event.

Let's say your event starts at 10:00 am and ends at 10:30 am. With the above configuration, if you drag the event up (just a little bit) the new times will be: starts at 10:05 am and ends at 10:35 am, and so on.

You can find more details at http://fullcalendar.io/docs/agenda/snapDuration/.

like image 128
Almir Campos Avatar answered Jan 09 '23 06:01

Almir Campos