【发布时间】:2017-08-13 21:13:42
【问题描述】:
我正在使用 fullcalendar 为一所学校实施时间表,其中课程在整个月的特定日期进行,例如课程可以在 TTH 或 MWF、TWTH 等
我正在尝试实现周视图,但我想逐月导航,因此我不必在整个月的每个特定日期都显示相同的课程(月视图)。受this question 的启发,我尝试实现以下内容:
$('#calendar').fullCalendar({
defaultView: 'customWeek',
views: {
customWeek: {
type: 'week',
duration: {months: 1}
}
}
});
但是这个实现并没有强制视图在月初开始,所以如果我浏览日历,下一个视图将在每月的第二天或第三天,或者有时在最后一天开始上个月。
我还尝试使它在月视图上与 CSS 一起使用,使其看起来像周视图:
.fc-day-top .fc-day-number{
display: none;
}
.fc td {
border-bottom: 0 !important;
border-top: 0 !important;
}
.fc-head {
border-top: 1px solid black !important;
border-bottom: 1px solid black !important;
}
.fc-body{
border-bottom: 1px solid black !important;
}
但我丢失了日历开头的时间段,事件卡在了顶部,看起来很糟糕。
所以我正在寻找完成这项任务的最佳方法。
【问题讨论】:
-
您的问题到底是什么?您需要像 now() 这样的默认日期吗?
-
我想在周视图中显示特定月份的课程,并允许用户逐月导航(而不是逐周)
-
你的意思是周视图的用户和月视图的用户不同?我的意思是当用户登录到您的系统时。或者它只是用户的一个角色。
-
一个用户角色?
i want to show the classes taken for a specific month in a week view, and allow the user to navigate month by month( not week by week) -
@LouysPatriceBessette 如果我能展示第一个完整的一周,那就太好了。谢谢你的时间:)
标签: jquery angularjs fullcalendar