Calendar 完整日历日期&;时间格式
1.在事件中开始日期:2015-02-09,结束日期:2015-02-13, 但日历视图仅显示第9个日期到第12个日期 如何解决此问题? 2.我需要日期格式。。我不需要时间 如何解决这个问题 需要您的帮助吗? 代码:Calendar 完整日历日期&;时间格式,calendar,fullcalendar,google-calendar-api,Calendar,Fullcalendar,Google Calendar Api,1.在事件中开始日期:2015-02-09,结束日期:2015-02-13, 但日历视图仅显示第9个日期到第12个日期 如何解决此问题? 2.我需要日期格式。。我不需要时间 如何解决这个问题 需要您的帮助吗? 代码: $('#calendar').fullCalendar({ header: { left: 'prev,next', center: 'title',
$('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
firstDay: 0,
editable: false,
droppable: false,
events: [
{
title: 'Live Conference',
start: '2015-02-09',
end: '2015-02-13',
}, {
title: 'Top Secret Project',
start: '2015-02-14',
end: '2015-02-16',
color: '#1abc9c'
},
{
title: 'Free Pizza',
description: 'This is just a fake description for the Free Pizza.Nothing to see!',
start: '2015-02-14',
end: '2015-02-16',
}, {
title: 'Free Pizza 2',
description: 'This is sdfsfption for the Free Pizza.Nothing to see!',
start: new Date(y, m, 17),
end: new Date(y, m, 19),
}
],
eventClick: function(event, jsEvent, view) {
$('#editevent').modal('show');
$('#modalTitle').val(event.title);
$('#modalStartDate').val(event.start);
$('#modalEndDate').val(event.end);
$('#modalBody').val(event.description);
//$('#eventUrl').attr('href',event.url);
}
});
我猜您正在使用fullcalendar 1.x。确保至少升级到1.6.4 然后将
时区设置为本地:
$('#calendar').fullcalendar({
...
timezone: 'local',
...
});
请参见以下示例:
自fullcalendar 2.0版以来,它与momentJS集成。它为日期对象的创建和操作提供了一个非常好的界面。如果这在您的项目中是可能的,我建议您使用它。请改进您的问题。到目前为止你都试了些什么?谢谢你的回复。。我需要以dd-mm-yyyy格式获取开始和结束日期…我理解您的要求,但StackOverflow是一个您发布有关您遇到的问题的问题的网站,而不是一个期望其他人完成您的工作的要求列表。那么你有没有试着自己解决这个问题,然后遇到了问题?你犯了什么错误?@aberna谢谢你的快速回复。。在活动中:标题:“现场会议”,开始:“2015-02-09”,结束:“2015-02-13”,但日历显示如下