文本自定义之 timeFormat – FullCalendar 中文文档
2014-02-10 · 213 chars · 2 min read
设置每个事件的时间格式,值为字符串或者View Option Hash,默认值:
{
// 日程周视图和日程天视图
agenda: 'h:mm{ - h:mm}', // 5:00 - 6:30
// 其他视图
'': 'h(:mm)t' // 7p
}
如果使用一个格式化字符串(例如 h:mm{ – h:mm})将改变所有的视图,使用View Option Hash可以指定给某些视图设定时间格式(默认值就是这么做的)。
使用 formatDate/formatDates 格式规则。
只有 Event Object 的 allday 为 false 的才显示时间。
所有事件使用 24 小时制的例子:
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01T14:30:00',
allDay: false,
},
// other events here...
],
timeFormat: 'H(:mm)', // uppercase H for 24-hour clock
})


