html - FullCalendar v5 的年视图
问题描述
我正在使用带有反应的 FullCalendar v5。我需要显示一个年份视图,就像 GoogleCalendar 那样:https ://prnt.sc/vljfwj 。我已经看到 FullCalendar 没有插件或smth。我想要做的是创建一个自定义视图,但我似乎没有很好地管理它。有人可以帮助我了解它是如何完成的吗?
<FullCalendar
plugins={[dayGridPlugin, timeGridPlugin, interactionPlugin]}
headerToolbar={false}
initialView='timeGridWeek'
views={{
dayGridMonth: {
type: 'month',
duration: { months: 12 },
monthMode: true,
fixedWeekCount: true,
}
}}
dayHeaderFormat={{ weekday: 'long', day: 'numeric', omitCommas: true }}
/>
我正在更改按钮的视图,该按钮调用此代码
changeSelectedGrid = selectedViewGrid => {
if (this.fullCalendarRef.current) {
const calendarApi = this.fullCalendarRef.current.getApi();
calendarApi.changeView(selectedViewGrid, moment(this.state.selectedDate).startOf('year'), moment(this.state.selectedDate).endOf('year'));
}
};
解决方案
推荐阅读
- html - (Odoo 报告)如何在每个产品的页面开头粘贴字段值
- cursor - 从 SQLite 数据库 Android 查询
- php - AWS:SNS 电子邮件 - 自定义任何主题的 SNS 订阅确认电子邮件
- wpf - 即使设置了 WindowChrome 也会出现默认标题栏
- google-cloud-platform - 在 GCP 中,如何处理作为测试部署一部分的 KMS?
- c++ - 来自另一个字节数组的双精度数组的别名
- php - Laravel foreach 模型
- arrays - 如何制作一个改变实例属性的函数?
- kotlin - 强制应用内深层链接网址在 chrome 而不是 android 应用中打开
- java - 在java中创建对象后更改对象字段