Show events in fullcalendar.js shift (morning, afternoon, evening, night) to view basicDay and view basicWeek

I have many events every day. Is there a way to separate these events into horizontally related categories? Can I add an additional flag (or class: morning, afternoon, evening, night) along with "title:" and "start:" so that events are organized in the appropriate horizontal shifts on the same day? I used

start: new Date(y,m,d,h,i),
allDay:false

      

to show different events on the same day.

Then I could limit to only 5 events per shift using eventLimit. postscript I only use basicDay and basicWeek.

+3


source to share


2 answers


You can add the className parameter to the youe event object. And another class with color, checking the time of the event.

how

var eventClass = '';

if (event.start > night && event.start < day) {
  var eventClass = 'morningClass';
} else if (event.start > morning &&  event.start <  evening) {
  var eventClass = 'dayClass';
} else if (event.start > day &&  event.start <  night) {
  var eventClass = 'eveningClass';
} else if (event.start > evening &&  event.start <  morning) {
  var eventClass = 'nightClass';
}

      



then

start: new Date(y,m,d,h,i),
allDay:false,
className: eventClass

      

and based on countName count (using clientEvents (method) ) you can limit 5 events per shift.

+1


source


As I understand your requirement, you need to use the resource view feature in the calendar. Here is a post on resource view



0


source







All Articles