完整日历未显示所选日期
Full Calender not showing selected Date
我想在日期 Select
上弹出 selectedDate
我使用了之前 post 的解决方案:
get selected date from 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"));
}
});
});
但仍然无法正常工作....日历看起来很好
我错过了什么。我是否在 miissng 任何外部 CSS 或 JQuery link ??
控制台的 F12 是你的朋友 ;)
hasTime 不是一个函数,因此将这一行更改为这样行得通:
var allDay = !start.hasTime && !end.hasTime;
fiddle:
http://jsfiddle.net/5o66w860/
我想在日期 Select
上弹出 selectedDate我使用了之前 post 的解决方案:
get selected date from 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"));
}
});
});
但仍然无法正常工作....日历看起来很好
我错过了什么。我是否在 miissng 任何外部 CSS 或 JQuery link ??
控制台的 F12 是你的朋友 ;)
hasTime 不是一个函数,因此将这一行更改为这样行得通:
var allDay = !start.hasTime && !end.hasTime;
fiddle: http://jsfiddle.net/5o66w860/