[英]React FullCalendar does not show the time although time is specified and allDay is false
我正在創建一個每周顯示事件的日歷。
像這樣https://fullcalendar.io/docs/timegrid-standard-view-demo
我將allDayDefault
道具指定為false
,並在事件道具中指定了json數據。
allDay
值定義為false
對象在全天區域中顯示良好。
但是不顯示allDay
值定義為true
對象。
<FullCalendar
defaultView="timeGridWeek"
plugins={[ timeGridPlugin, dayGridPlugin ]}
header={{
left: 'prev,next today',
center: 'title',
right: 'timeGridWeek,timeGridDay',
}}
nowIndicator={true}
allDayText="All Day"
allDayDefault={false}
locale='ko'
timeZone='UTC'
events={[
{
// not visible
id: 1,
title: "event 1",
start: "2019-05-21T11:00:00+09:00",
end: "2019-05-21T13:00:00+09:00",
allDay: false,
},
{
// not visible
id: 2,
title: "event 2",
start: "2019-05-21T11:00:00+09:00",
end: "2019-05-21T13:00:00+09:00",
},
{
// visible on All Day area
id: 3,
title: 'event 3',
start: "2019-05-21T11:00:00+09:00",
end: "2019-05-21T13:00:00+09:00",
allDay: true,
},
{
// not visible
id: 4,
title: 'event 4',
start: moment().toDate(),
end: moment().add(1, "days").toDate(),
},
{
// visible on All Day area
id: 5,
title: 'event 5',
date: '2019-05-20',
allDay: true,
},
{
// not visible
id: 6,
title: 'event 6',
date: '2019-05-20',
},
{
// not visible
id: 7,
title: 'event 7',
date: '2019-05-20',
allDay: false,
},
]}
scrollTime={'08:00:00'}
/>
我通過添加一行代碼height: 100%
解決了這個問題。
@ fullcalendar / timegrid / main.css的
.fc-time-grid .fc-content-skeleton {
position: absolute;
z-index: 3;
top: 0;
left: 0;
right: 0; }
to
.fc-time-grid .fc-content-skeleton {
position: absolute;
z-index: 3;
top: 0;
left: 0;
right: 0;
height: 100%; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.