我在议程周 View 中使用全日历。我注意到单个时段中的事件(例如 30 分钟)不会显示结束时间。结束时间仅出现在覆盖多个时段的事件上。 我找到的所有选项都没有将其添加到事件标题中。
这可能吗,只是我没看到? 感谢您的任何建议!
编辑: 这就是我指的工具。 http://fullcalendar.io/
最佳答案
在函数 renderEventTable
中,有一个条件,如果事件小于 30px,则添加 css 类。
if (seg.bottom - seg.top < 30) {
seg.el.addClass('fc-short');
}
所以基本上您只需编辑 .fc-short
的 CSS 样式即可。
fc-time-grid-event.fc-short .fc-time span {
display: none; /* don't display the full time text... */
}
.fc-time-grid-event.fc-short .fc-time:before {
content: attr(data-start); /* ...instead, display only the start time */
}
.fc-time-grid-event.fc-short .fc-time:after {
content: "\000A0-\000A0"; /* seperate with a dash, wrapped in nbsp's */
}
关于events - 全日历单槽事件结束时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26348955/