FullCalendar 4 inverse-background

大憨熊 提交于 2019-12-08 13:41:39

问题


I have problem with Inverse Backgrounds in FullCalendar v4.0.2.

code:

let calendarEl = document.getElementById(this.element_id);
this.calendar = new FullCalendar.Calendar(calendarEl, {
    plugins: [ 'timeGrid' ],
    height: "auto",
    nowIndicator : true,
    defaultView: 'timeGridDay',
    events: [
        {
            id: 2,
            start: '2019-04-17 10:00:00',
            end: '2019-04-17 11:00:00',
            color: 'blue',
            rendering: 'inverse-background'
        } , {
            id: 2,
            start: '2019-04-17 14:00:00',
            end: '2019-04-17 15:00:00',
            color: 'green',
            rendering: 'inverse-background'
        }
    ]
});
this.calendar.render();

when i use this code events that share the same id wouldn't grouped together when this rendering happens.


回答1:


I'm not entirely sure but I think you're using the wrong view for that type of rendering.

const el = document.querySelector("#calendar");

const calendar = new FullCalendar.Calendar(el, {
  plugins: ['timeGrid'],
  defaultView: 'timeGridWeek',
     events: [
        {
            id: 2,
            start: '2019-04-17 10:00:00',
            end: '2019-04-17 11:00:00',
            color: 'blue',
            rendering: 'inverse-background'
        } , {
            id: 2,
            start: '2019-04-17 14:00:00',
            end: '2019-04-17 15:00:00',
            color: 'blue',
            rendering: 'inverse-background'
        }
    ]
});

calendar.render();

https://codepen.io/anon/pen/rbJyzv 👀



来源:https://stackoverflow.com/questions/55725336/fullcalendar-4-inverse-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!