完整日历错误时间点击事件谷歌日历

时间:2015-03-07 14:22:25

标签: javascript jquery fullcalendar

我需要让Google日历看起来很适合客户端,所以我使用的是Fullcalendar,它现在看起来很棒,谢谢! 我有一个问题: 当我点击某个事件时,详细信息会显示GMT时间。我尝试过一些东西,但我绝对不是开发人员,所以我需要帮助:)

任何帮助将不胜感激!这是我到目前为止的js代码:

$(document).ready(function() {

    $('#calendar').fullCalendar({

        theme: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        googleCalendarApiKey: 'my api key',

        events: 'my event',

        eventClick: function(event) {
            // opens events in a popup window

            window.open(event.url, 'gcalevent', 'width=600,height=400');
            return false;
            $scope.start = event;
        },

        loading: function(bool) {
            $('#loading').toggle(bool);

        }
    }); 
});

1 个答案:

答案 0 :(得分:0)

$(document).ready(function() {

    $('#calendar').fullCalendar({
        events: function(start, end, timezone, callback) {
            $.ajax({
               url: 'my calendar xml link',
               dataType: 'xml',
               data: {

                   start: start.unix(),
                   end: end.unix()
               },
               success: function(doc) {
                   var events = [];
                   $(doc).find('event').each(function() {
                       events.push({
                           title: $(this).attr('title'),
                           start: $(this).attr('start') // will be parsed
                       });
                   });
                   callback(events);
               }
           });
        }, 
        theme: true,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        googleCalendarApiKey: 'my api key',

        events: 'my calendar id',

        eventClick: function(event) {
            // opens events in a popup window


            window.open(event.url, 'gcalevent', 'width=600,height=400');
            return false;
            $scope.start = event;
        },

        loading: function(bool) {
            $('#loading').toggle(bool);

        }   

    });

});