fullcalendar - 在 dayGridWeek 中显示时间
fullcalendar - display time in dayGridWeek
我使用全日历来显示事件,但我遇到了问题。 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();
}
};
提前致谢
我有这样的结果:
但是如何得到这个结果:
您已将默认视图设置为 'dayGridWeek'
设置为:
defaultView: 'timeGridWeek'
你应该没问题...
我使用全日历来显示事件,但我遇到了问题。 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();
}
};
提前致谢
我有这样的结果:
但是如何得到这个结果:
您已将默认视图设置为 'dayGridWeek'
设置为:
defaultView: 'timeGridWeek'
你应该没问题...