【发布时间】:2021-08-05 06:46:30
【问题描述】:
我在我的项目中将 FullCalendar.io React 组件用于所有日历用例。有没有办法只显示 3 天而不是一周中的所有天?我尝试过使用 views 属性,但它没有用。
<FullCalendar
plugins={[ dayGridPlugin, interactionPlugin , timeGridPlugin]}
views = {{
agendaThreeDay: {
type: 'agenda',
duration: { days: 3 },
buttonText: '3 day'
}
}}
selectable
initialView = {agendaThreeDay}
/>
【问题讨论】:
-
你能通过
duration= { days: 4 }并检查吗?作为另一个道具 -
"agenda" 不是视图类型...尝试
type: "timeGrid"。 -
@Amruth 为什么要设置 4 天的持续时间来获得 3 天的视图?这根本没有意义。
-
@ADyson 糟糕。我从文档中复制了它的
duration= { days: 3 } -
@Amruth 你是想说 OP 应该使用 React 插件语法来声明这个选项吗?你可能是对的,但它不仅仅需要改变一个:to =.
标签: javascript reactjs fullcalendar fullcalendar-5