0

我使用 fullcalendar 来显示事件,但我有问题。如何在dayGridWeek的左侧显示时间?

代码js:

var displayDisponibiltyBabySitter = function(){
            var calendarEl = document.getElementById('disponiblity');
            if(calendarEl){
                var calendar = new FullCalendar.Calendar(calendarEl, {
                    defaultView: 'dayGridWeek' ,
                    validRange: function(nowDate){
                        return {start: nowDate}
                    },
                    header: {
                        left: 'prev,next today',
                        center: 'title',
                        right: 'dayGridWeek,timeGridDay'
                    },
                    locale: _mpop.current_lang,
                    timeZone: 'Europe/Paris',
                    eventBackgroundColor : "#444",
                    eventTextColor: '#EEE',
                    slotDuration: '00:60:00',
                    slotLabelFormat: [
                        {
                            hour: '2-digit',
                            minute: '2-digit',
                            hour12: false
                        }
                    ],
                    views: {
                        dayGridWeek: {
                            eventTimeFormat: {
                                hour: 'numeric',
                                minute: '2-digit',
                                omitZeroMinute: true,
                                meridiem: 'narrow'
                            }
                        }
                    },
                    events: Routing.generate('front.babysitter.disponibilities',{'id': $("#dispo-babysitter").data("id")}),
                    plugins: [ 'dayGrid', 'timeGrid', 'list' ]
                });
                calendar.render();
            }

        };

提前致谢

我有这个结果:

但如何得到这个结果:

4

1 回答 1

6

您已将 defaultView 设置为“dayGridWeek”

将其设置为:

defaultView: 'timeGridWeek'

你应该没事...

于 2019-05-29T13:09:53.730 回答