我想弹出选择日期日期选择
我使用了上一篇文章的解决方案:
这是我的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/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句