完整日历不显示所选日期 [英] Full Calender not showing selected Date

查看:212
本文介绍了完整日历不显示所选日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Date Select上弹出selectedDate

I want to popup selectedDate on Date Select

我使用了上一篇文章的解决方案:

I used a solution from previous post :

a href =http://stackoverflow.com/questions/3959258/get-selected-date-from-fullcalendar-jquery>从fullcalendar jquery 获取选择的日期

get selected date from fullcalendar jquery

这是我的jsfiddle

this is my jsfiddle

http:/ /jsfiddle.net/100thgear/h9cc6/

我的代码(Firebug没有错误)

My Code (No Error on 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"));
    }
});
});

但是它不工作....日历很好

but still it is not working ....Calender appears Fine

我缺少什么.Am我miissng任何外部CSS或JQuery链接?

What Am I missing .Am I miissng Any External CSS or JQuery link ??

推荐答案

F12控制台是你的朋友;)

F12 for the console is your friend ;)

hasTime不是一个函数,所以将一行改成这样:

hasTime is not a function, so changing the one line to this worked:

var allDay = !start.hasTime && !end.hasTime;

fiddle:
http://jsfiddle.net/5o66w860/

这篇关于完整日历不显示所选日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆