jQuery FullCalendar event sorting

前端 未结 5 1182
南方客
南方客 2020-12-16 05:24

I have numerous events that are all day events, and all start at the same time. I create the events in the order I would like them to appear on the full calendar view, but t

5条回答
  •  难免孤独
    2020-12-16 05:49

    In the fullcalendar.js file, there is a function called

    compareSegs(seg1, seg2){
        return seg1.eventStartMS - seg2.eventStartMS || seg2.eventDurationMS - seg1.eventDurationMS || seg2.event.allDay - seg1.event.allDay ||  (seg1.event.title || '').localeCompare(seg2.event.title);
    }. 
    

    you can define your own rules such as return seg1.id -seg2.id to order events by id.

提交回复
热议问题