Fullcalendar 查看事件自定义

时间:2021-03-08 09:49:54

标签: fullcalendar

在 eventRender 中我怎么知道我们是否正在查看 'timelineDay' 或 'timelineWeek' 或 'timelineMonth' 根据视图自定义事件??

    header: {
      left: 'prev today next',
      center: 'title',
      right: 'timelineDay,timelineWeek,timelineMonth',
    },

谢谢

enter image description here

 var timeline = $('#calendar').fullCalendar('getView').name;
  if (timeline ==="timelineWeek"){
        var eventcustom =
            '<div class="wrapper-event-weekly">'
              +'<div class="box-event-weekly box-event-ico col-1">'
                +'<i class="'+e.icon+' fa-2x"></i>'
                +'</div>'  
              +'<div class="box-event-weekly box-event-title col-10">'
                +'<span>'+e.odldesc+'</span></br>'
                +'<span><b>'+e.odlnum+'</b></span>'
              +'</div>'
              +'<div class="box-event-weekly box-event-info col-1">'
                +'<i class="'+note+' fa-lg"></i>'
              +'</div>'
            +'</div>'; 
        }      
  else if (timeline ==="timelineMonth"){      
        var eventcustom =
            '<div class="wrapper-event-month">'
              +'<div class="box-event-month box-event-ico col-12">'
                +'<i class="'+e.icon+' fa-2x"></i>'
                +'</div>'  
              +'<div class="box-event-month box-event-title col-12">'
                +'<span>'+e.odldesc+'</span></br>'
                +'<span><b>'+e.odlnum+'</b></span>'
              +'</div>'
              +'<div class="box-event-month box-event-info col-12">'
                +'<i class="'+note+' fa-lg"></i>'
              +'</div>'
            +'</div>';   
          } 

0 个答案:

没有答案