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
83
attachment: gcal.js
(2.0 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
/*!
* FullCalendar Google Calendar Extension
*
* Visit http://arshaw.com/fullcalendar/docs/#google-calendar
* for docs and examples.
*
* Copyright (c) 2009 Adam Shaw
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Date:
* Revision:
*/
(function($) {
$.fullCalendar.gcalFeed = function(feedUrl, options) {
feedUrl = feedUrl.replace(/\/basic$/, '/full');
options = options || {};
var draggable = options.draggable || false;
return function(start, end, callback) {
$.getJSON(feedUrl + "?alt=json-in-script&callback=?",
{
'start-min': $.fullCalendar.formatDate(start, 'c'),
'start-max': $.fullCalendar.formatDate(end, 'c'),
'singleevents': true,
'max-results': 1000
},
function(data) {
var events = [];
if (data.feed.entry)
$.each(data.feed.entry, function(i, entry) {
var url;
$.each(entry['link'], function(j, link) {
if (link.type == 'text/html') url = link.href;
});
var showTime = entry['gd$when'][0]['startTime'].indexOf('T') != -1;
var classNames = [];
if (showTime) {
classNames.push('nobg');
}
if (options.className) {
if (typeof options.className == 'string') {
classNames.push(options.className);
}else{
classNames = classNames.concat(options.className);
}
}
events.push({
id: entry['gCal$uid']['value'],
url: url,
title: entry['title']['$t'],
start: $.fullCalendar.parseDate(entry['gd$when'][0]['startTime']),
end: $.fullCalendar.parseDate(entry['gd$when'][0]['endTime']),
location: entry['gd$where'][0]['valueString'],
description: entry['content']['$t'],
showTime: showTime,
className: classNames,
draggable: draggable
});
});
alert(events.length);
callback(events);
});
}
}
})(jQuery);
Powered by
Google Project Hosting