完整日历未显示所选日期
我想在日期选择上弹出selectedDate
我使用了之前post的解决方案:
从fullcalendar jquery获取选定日期
这是我的jsfiddle
http://jsfiddle.net/100thgear/h9cc6/
我的代码(Firebug没有错误)
$(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var events_array = [ { title: 'Test1', start: new Date(2012, 8, 20), tip: 'Personal tip 1'}, { title: 'Test2', start: new Date(2012, 8, 21), tip: 'Personal tip 2'} ]; $('#calendar').fullCalendar({ selectable: true, select: function(start, end, jsEvent, view) { // start contains the date you have selected // end contains the end date. // Caution: the end date is exclusive (new since v2). var allDay = !start.hasTime() && !end.hasTime(); alert(["Event Start date: " + moment(start).format(), "Event End date: " + moment(end).format(), "AllDay: " + allDay].join("\n")); } }); });
但它仍然无法正常工作….日历显得很好
我错过了什么。我是不是有任何外部CSS或JQuery链接?
控制台的F12是你的朋友;)
hasTime不是一个函数,所以将一行更改为:
var allDay = !start.hasTime && !end.hasTime;
小提琴: http : //jsfiddle.net/5o66w860/