将完整日历与Google日历集成添加'其中' /' location'领域

时间:2014-08-28 21:28:06

标签: jquery events fullcalendar google-calendar-api

我已将完整日历与我的Google日历集成,我已点击每个活动已停用,因为我不想与我网站上的其他人分享活动的所有详细信息。我只是想在我忙碌和自由时表现出来。 问题是我甚至想要隐藏事件的标题,只显示“位置”。或者'其中'谷歌事件的领域。虽然我得到的回复包括位置,但我不知道应该如何获取并显示它。 这是我的代码:

    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    events: {
        url: 'https://www.google.com/calendar/feeds/a06g3aano640bal6idonn44ves%40group.calendar.google.com/public/basic',
        className: 'gcal-event',
        color: 'yellow',   // an option!
        textColor: 'black'
    },
    eventRender: function (event, element, view) {
        if ( event.allDay) {
            element.css({'background-color': 'red',
                         'border':'1px solid red'});
        }
    },
    eventClick: function(event) {
        if (event.url) {
            return false;
        }
    },

2 个答案:

答案 0 :(得分:1)

它并不复杂,只需检查位置是否设置在eventRender内。如果是,则将其显示为标题,否则显示默认文本:

var title = ( event.location ) ? event.location : 'Doing something';
element.html(title);

答案 1 :(得分:0)

是的,我是通过更改fullcalendar.js文件来实现的,该文件设置为" title"我把它改成了event.location,它确实有效:) 但是现在我还有另一个问题,我仍在调查事件对象,但我找不到它。并且我必须检查事件的忙/可用性以相应地改变该事件的颜色。但还是没有弄明白。