My favorites
▼
|
Sign in
fullcalendar
ISSUE TRACKER HAS MOVED. DO NOT USE THIS (more info)
Project Home
Issues
Export to GitHub
New issue
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
803
attachment: gcal.js
(2.5 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* FullCalendar v1.4.10 Google Calendar Extension
*
* Copyright (c) 2010 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Sat Jan 1 23:46:27 2011 -0800
*
*/
(function($) {
$.fullCalendar.gcalFeedArray = function(feedArray) {
return function(start, end, callback) {
var totalEvents = [];
var nrFeedsCollected = 0;
if(feedArray.length == 0)
callback(totalEvents); //All feeds collected: use callback
for (i=0;i<feedArray.length;i++) {
feedUrl = feedArray[i][0];
feedUrl = feedUrl.replace(/\/basic$/, '/full');
options = feedArray[i][1] || {};
var params = {
'start-min': $.fullCalendar.formatDate(start, 'u'),
'start-max': $.fullCalendar.formatDate(end, 'u'),
'singleevents': true,
'max-results': 9999,
'events' : totalEvents
};
var ctz = options.currentTimezone;
if (ctz) {
params.ctz = ctz = ctz.replace(' ', '_');
}
$.getJSON(feedUrl + "?alt=json-in-script&callback=?", params, function(data) {
if (data.feed.entry) {
$.each(data.feed.entry, function(i, entry) {
var startStr = entry['gd$when'][0]['startTime'],
start = $.fullCalendar.parseISO8601(startStr, true),
end = $.fullCalendar.parseISO8601(entry['gd$when'][0]['endTime'], true),
allDay = startStr.indexOf('T') == -1,
url;
$.each(entry.link, function() {
if (this.type == 'text/html') {
url = this.href;
if (ctz) {
url += (url.indexOf('?') == -1 ? '?' : '&') + 'ctz=' + ctz;
}
}
});
if (allDay) {
$.fullCalendar.addDays(end, -1); // make inclusive
}
totalEvents.push({
id: entry['gCal$uid']['value'],
title: entry['title']['$t'],
url: url,
start: start,
end: end,
allDay: allDay,
location: entry['gd$where'][0]['valueString'],
description: entry['content']['$t'],
className: options.className,
editable: options.editable || false
});
});
}
nrFeedsCollected++;
if (nrFeedsCollected === feedArray.length) {
callback(totalEvents); //All feeds collected: use callback
}
});
}
}
}
})(jQuery);
Powered by
Google Project Hosting