完整日历 - 如何在周视图中添加一天中的时间
Fullcalendar - How to add time of the day in week view
默认周视图是这样的,左侧没有一天中的时间:
http://fullcalendar.io/views/basicWeek/
但我想以这种方式查看,一天中的时间在左侧:
http://fullcalendar.io/js/fullcalendar-2.3.1/demos/agenda-views.html
单击上方按钮面板上的"周"以查看它。
如何配置它以使其看起来像这样?
谢谢!
要使用 defaultView
属性。这将设置日历加载时的初始视图,如文档中指定的那样。所需的特定视图是agendaWeek
(可用视图列表)。
因此,当您初始化日历时,您将defaultView: 'agendaWeek'
.
例:
$('#fullCal').fullCalendar({
events: [{
title: 'Random Event 1',
start: moment().add(-4, 'h'),
end: moment().add(-2, 'h'),
allDay: false
}, {
title: 'Random Event 2',
start: moment().add(1, 'h'),
end: moment().add(2, 'h'),
allDay: false
}, {
title: 'Random Event 3',
start: moment().add(6, 'h'),
end: moment().add(8, 'h'),
allDay: false
}],
header: {
left: '',
center: 'prev title next today',
right: ''
},
timezone: 'local',
defaultView: 'agendaWeek' /* this is the line you need */
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.js"></script>
<div id="fullCal"></div>
相关文章:
- 在不刷新整个网格的情况下,向Asp.net网格视图添加新行
- 如何将Web视图添加到Appgyver中的视图中
- 列表视图添加另一个不需要的页面项目
- 如何为模式窗口中呈现的部分视图添加滚动条
- AngularJS:尝试以编程方式向视图添加指令
- 即使使用“on”,JQuery 也无法识别通过主干视图添加的元素
- 从木偶中的空视图添加到收藏
- 主干集合视图添加未使用模型调用
- 如何在 ExtJS5 中从控制器向视图添加组件
- 向当前视图添加内容的主干
- 使用JSON和Backbone.js向视图添加值
- Titanium Studio JavaScript-向表视图添加按钮
- todo的一个简单应用程序,不向视图添加输入值
- 将视图添加到角度种子项目
- 在Angular JS中为单个视图添加完整的页面背景
- 从子视图向父视图添加新集合
- 组合优于继承,这是向视图添加额外功能而不诉诸继承的更好方式
- 在Ionic中,如何在for循环的每次迭代后向应用程序视图添加数据
- Joomla将脚本从视图添加到头部脚本的底部
- 如何为视图添加动态事件