Fullcalendar demo with a sample google iCal file

master
Tanguy Pruvot 2010-10-29 13:43:13 +02:00
rodzic 93a165fb82
commit 90db32ce7f
4 zmienionych plików z 5606 dodań i 0 usunięć

107
demo/basic.ics 100644
Wyświetl plik

@ -0,0 +1,107 @@
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Particuliers - Grand Tour du Bassin
X-WR-TIMEZONE:Europe/Paris
X-WR-CALDESC:
BEGIN:VTIMEZONE
TZID:Europe/Paris
X-LIC-LOCATION:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20100526T143000
DTEND;TZID=Europe/Paris:20100526T171500
DTSTAMP:20101028T215738Z
UID:ptb5jqomu2vu0sr2nm24qungag@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Partic
uliers - Grand Tour du Bassin;X-NUM-GUESTS=0:mailto:l2n7ajiud0oaiua4qcdarg1
krg@group.calendar.google.com
RECURRENCE-ID;TZID=Europe/Paris:20100526T143000
CREATED:20100428T225030Z
DESCRIPTION:
LAST-MODIFIED:20100527T102538Z
LOCATION:Jetée Thiers\, Arcachon
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Horaire
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20100403T143000
DTEND;TZID=Europe/Paris:20100403T171500
RRULE:FREQ=WEEKLY;WKST=MO;UNTIL=20100630T123000Z;BYDAY=SU,WE,SA
DTSTAMP:20101028T215738Z
UID:ptb5jqomu2vu0sr2nm24qungag@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=Partic
uliers - Grand Tour du Bassin;X-NUM-GUESTS=0:mailto:l2n7ajiud0oaiua4qcdarg1
krg@group.calendar.google.com
CREATED:20100428T225030Z
DESCRIPTION:
LAST-MODIFIED:20100518T052328Z
LOCATION:Jetée Thiers\, Arcachon
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Horaire
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20101002T143000
DTEND;TZID=Europe/Paris:20101002T171500
RRULE:FREQ=WEEKLY;BYDAY=SU,SA;WKST=MO
DTSTAMP:20101028T215738Z
UID:41v060qrjvpvsv90n6ulljjeg4@google.com
CREATED:20100428T225427Z
DESCRIPTION:
LAST-MODIFIED:20100518T052328Z
LOCATION:Jetée Thiers\, Arcachon
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Horaire
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20100703T143000
DTEND;TZID=Europe/Paris:20100703T171500
RRULE:FREQ=DAILY;UNTIL=20100930T123000Z;WKST=MO
DTSTAMP:20101028T215738Z
UID:92tmcm95ktr40ofn3okf0hhr2c@google.com
CREATED:20100428T225334Z
DESCRIPTION:
LAST-MODIFIED:20100518T052327Z
LOCATION:Jetée Thiers\, Arcachon
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Horaire
TRANSP:TRANSPARENT
END:VEVENT
BEGIN:VEVENT
DTSTART:20100513T123000Z
DTEND:20100513T151500Z
DTSTAMP:20101028T215738Z
UID:254jd6v58v92k7bj69sgu3ulb0@google.com
CREATED:20100428T225221Z
DESCRIPTION:
LAST-MODIFIED:20100518T052327Z
LOCATION:Jetée Thiers\, Arcachon
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Horaire
TRANSP:TRANSPARENT
END:VEVENT
END:VCALENDAR

Wyświetl plik

@ -0,0 +1,615 @@
/*
* FullCalendar v1.4.8-IE9 Stylesheet
*
* Feel free to edit this file to customize the look of FullCalendar.
* When upgrading to newer versions, please upgrade this file as well,
* porting over any customizations afterwards.
*
* Date: Mon Oct 25 02:35:06 2010 +0200
*
*/
/* TODO: make font sizes look the same in all doctypes */
.fc,
.fc .fc-header,
.fc .fc-content {
font-size: 1em;
}
.fc {
direction: ltr;
text-align: left;
}
.fc table {
border-collapse: collapse;
border-spacing: 0;
}
.fc td, .fc th {
padding: 0;
vertical-align: top;
}
/* Header
------------------------------------------------------------------------*/
table.fc-header {
width: 100%;
}
.fc-header-left {
width: 25%;
}
.fc-header-left table {
float: left;
}
.fc-header-center {
width: 50%;
text-align: center;
}
.fc-header-center table {
margin: 0 auto;
}
.fc-header-right {
width: 25%;
}
.fc-header-right table {
float: right;
}
.fc-header-title {
margin-top: 0;
white-space: nowrap;
}
.fc-header-space {
padding-left: 10px;
}
/* right-to-left */
.fc-rtl .fc-header-title {
direction: rtl;
}
/* Buttons
------------------------------------------------------------------------*/
.fc-header .fc-state-default,
.fc-header .ui-state-default {
margin-bottom: 1em;
cursor: pointer;
}
.fc-header .fc-state-default {
border-width: 1px 0;
padding: 0 1px;
}
.fc-header .fc-state-default,
.fc-header .fc-state-default a {
border-style: solid;
}
.fc-header .fc-state-default a {
display: block;
border-width: 0 1px;
margin: 0 -1px;
width: 100%;
text-decoration: none;
}
.fc-header .fc-state-default span {
display: block;
border-style: solid;
border-width: 1px 0 1px 1px;
padding: 3px 5px;
}
.fc-header .ui-state-default {
padding: 4px 6px;
}
.fc-header .fc-state-default span,
.fc-header .ui-state-default span {
white-space: nowrap;
}
/* for adjacent buttons */
.fc-header .fc-no-right {
padding-right: 0;
}
.fc-header .fc-no-right a {
margin-right: 0;
border-right: 0;
}
.fc-header .ui-no-right {
border-right: 0;
}
/* for fake rounded corners */
.fc-header .fc-corner-left {
margin-left: 1px;
padding-left: 0;
}
.fc-header .fc-corner-right {
margin-right: 1px;
padding-right: 0;
}
/* DEFAULT button COLORS */
.fc-header .fc-state-default,
.fc-header .fc-state-default a {
border-color: #777; /* outer border */
color: #333;
}
.fc-header .fc-state-default span {
border-color: #fff #fff #d1d1d1; /* inner border */
background: #e8e8e8;
}
/* PRESSED button COLORS (down and active) */
.fc-header .fc-state-active a {
color: #fff;
}
.fc-header .fc-state-down span,
.fc-header .fc-state-active span {
background: #888;
border-color: #808080 #808080 #909090; /* inner border */
}
/* DISABLED button COLORS */
.fc-header .fc-state-disabled a {
color: #999;
}
.fc-header .fc-state-disabled,
.fc-header .fc-state-disabled a {
border-color: #ccc; /* outer border */
}
.fc-header .fc-state-disabled span {
border-color: #fff #fff #f0f0f0; /* inner border */
background: #f0f0f0;
}
/* Content Area & Global Cell Styles
------------------------------------------------------------------------*/
.fc-widget-content {
border: 1px solid #ccc; /* outer border color */
}
.fc-content {
clear: both;
}
.fc-content .fc-state-default {
border-style: solid;
border-color: #ccc; /* inner border color */
}
.fc-content .ui-state-highlight,
.fc-content .fc-state-highlight { /* today */
background: #ffd;
}
.fc-content .fc-not-today { /* override jq-ui highlight (TODO: ui-widget-content) */
background: none;
}
.fc-content .fc-before-today {
background: #fafafa;
}
.fc-cell-overlay { /* semi-transparent rectangle while dragging */
background: #9cf;
opacity: .2;
filter: alpha(opacity=20); /* for IE */
}
.fc-view { /* prevents dragging outside of widget */
width: 100%;
overflow: hidden;
}
/* Global Event Styles
------------------------------------------------------------------------*/
.fc-event,
.fc-agenda .fc-event-time,
.fc-event a {
border-style: solid;
border-color: #36c; /* default BORDER color (probably the same as background-color) */
background-color: #36c; /* default BACKGROUND color */
color: #fff; /* default TEXT color */
}
/* Use the 'className' CalEvent property and the following
* example CSS to change event color on a per-event basis:
*
* .myclass,
* .fc-agenda .myclass .fc-event-time,
* .myclass a {
* background-color: black;
* border-color: black;
* color: red;
* }
*/
.fc-event {
text-align: left;
}
.fc-event a {
overflow: hidden;
font-size: .85em;
text-decoration: none;
cursor: pointer;
}
.fc-event-editable {
cursor: pointer;
}
.fc-event-time,
.fc-event-title {
padding: 0 1px;
}
/* for fake rounded corners */
.fc-event a {
display: block;
position: relative;
width: 100%;
height: 100%;
}
/* right-to-left */
.fc-rtl .fc-event a {
text-align: right;
}
/* resizable */
.fc .ui-resizable-handle {
display: block;
position: absolute;
z-index: 99999;
border: 0 !important; /* important overrides pre jquery ui 1.7 styles */
background: url(data:image/gif;base64,AAAA) !important; /* hover fix for IE */
}
/* Horizontal Events
------------------------------------------------------------------------*/
.fc-event-hori {
border-width: 1px 0;
margin-bottom: 1px;
}
.fc-event-hori a {
border-width: 0;
}
/* for fake rounded corners */
.fc-content .fc-corner-left {
margin-left: 1px;
}
.fc-content .fc-corner-left a {
margin-left: -1px;
border-left-width: 1px;
}
.fc-content .fc-corner-right {
margin-right: 1px;
}
.fc-content .fc-corner-right a {
margin-right: -1px;
border-right-width: 1px;
}
/* resizable */
.fc-event-hori .ui-resizable-e {
top: 0 !important; /* importants override pre jquery ui 1.7 styles */
right: -3px !important;
width: 7px !important;
height: 100% !important;
cursor: e-resize;
}
.fc-event-hori .ui-resizable-w {
top: 0 !important;
left: -3px !important;
width: 7px !important;
height: 100% !important;
cursor: w-resize;
}
.fc-event-hori .ui-resizable-handle {
_padding-bottom: 14px; /* IE6 had 0 height */
}
/* Month View, Basic Week View, Basic Day View
------------------------------------------------------------------------*/
.fc-grid table {
width: 100%;
}
.fc .fc-grid th {
border-width: 0 0 0 1px;
text-align: center;
}
.fc .fc-grid td {
border-width: 1px 0 0 1px;
}
.fc-grid th.fc-leftmost,
.fc-grid td.fc-leftmost {
border-left: 0;
}
.fc-grid .fc-day-number {
float: right;
padding: 0 2px;
}
.fc-grid .fc-other-month .fc-day-number {
opacity: 0.3;
filter: alpha(opacity=30); /* for IE */
/* opacity with small font can sometimes look too faded
might want to set the 'color' property instead
making day-numbers bold also fixes the problem */
}
.fc-grid .fc-day-content {
clear: both;
padding: 2px 2px 0; /* distance between events and day edges */
}
/* event styles */
.fc-grid .fc-event-time {
font-weight: bold;
}
/* right-to-left */
.fc-rtl .fc-grid {
direction: rtl;
}
.fc-rtl .fc-grid .fc-day-number {
float: left;
}
.fc-rtl .fc-grid .fc-event-time {
float: right;
}
/* week numbers */
.fc .fc-grid th.fc-weeknumber {
border-top-width: 1px;
}
/* Agenda Week View, Agenda Day View
------------------------------------------------------------------------*/
.fc .fc-agenda th,
.fc .fc-agenda td {
border-width: 1px 0 0 1px;
}
.fc .fc-agenda .fc-leftmost {
border-left: 0;
}
.fc-agenda tr.fc-first th,
.fc-agenda tr.fc-first td {
border-top: 0;
}
.fc-agenda-head tr.fc-last th {
border-bottom-width: 1px;
}
.fc .fc-agenda-head td,
.fc .fc-agenda-body td {
background: none;
}
.fc-agenda-head th {
text-align: center;
}
/* the time axis running down the left side */
.fc-agenda .fc-axis {
width: 50px;
padding: 0 4px;
vertical-align: middle;
white-space: nowrap;
text-align: right;
font-weight: normal;
}
/* all-day event cells at top */
.fc-agenda-head tr.fc-all-day th {
height: 35px;
}
.fc-agenda-head td {
padding-bottom: 10px;
}
.fc .fc-divider div {
font-size: 1px; /* for IE6/7 */
height: 2px;
}
.fc .fc-divider .fc-state-default {
background: #eee; /* color for divider between all-day and time-slot events */
}
/* body styles */
.fc .fc-agenda-body td div {
height: 20px; /* slot height */
}
.fc .fc-agenda-body tr.fc-minor th,
.fc .fc-agenda-body tr.fc-minor td {
border-top-style: dotted;
}
.fc-agenda .fc-day-content {
padding: 2px 2px 0; /* distance between events and day edges */
}
/* vertical background columns */
.fc .fc-agenda-bg .ui-state-highlight {
background-image: none; /* tall column, don't want repeating background image */
}
/* Vertical Events
------------------------------------------------------------------------*/
.fc-event-vert {
border-width: 0 1px;
}
.fc-event-vert a {
border-width: 0;
}
/* for fake rounded corners */
.fc-content .fc-corner-top {
margin-top: 1px;
}
.fc-content .fc-corner-top a {
margin-top: -1px;
border-top-width: 1px;
}
.fc-content .fc-corner-bottom {
margin-bottom: 1px;
}
.fc-content .fc-corner-bottom a {
margin-bottom: -1px;
border-bottom-width: 1px;
}
/* event content */
.fc-event-vert span {
display: block;
position: relative;
z-index: 2;
}
.fc-event-vert span.fc-event-time {
white-space: nowrap;
_white-space: normal;
overflow: hidden;
border: 0;
font-size: 10px;
}
.fc-event-vert span.fc-event-title {
line-height: 13px;
}
.fc-event-vert span.fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #fff;
opacity: .3;
filter: alpha(opacity=30); /* for IE */
}
/* resizable */
.fc-event-vert .ui-resizable-s {
bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
width: 100% !important;
height: 8px !important;
line-height: 8px !important;
font-size: 11px !important;
font-family: monospace;
text-align: center;
cursor: s-resize;
}
/* JOMRES */
.gcal-blackbooking-0,
.fc-agenda .gcal-blackbooking-0 .fc-event-time,
.gcal-blackbooking-0 a {
border-style: solid;
border-color: #400; /* default BORDER color (probably the same as background-color) */
background-color: #D60; /* default BACKGROUND color */
color: #fff; /* default TEXT color */
}
.gcal-blackbooking-1,
.fc-agenda .gcal-blackbooking-1 .fc-event-time,
.gcal-blackbooking-1 a {
border-style: solid;
border-color: #400; /* default BORDER color (probably the same as background-color) */
background-color: #800; /* default BACKGROUND color */
color: #fff; /* default TEXT color */
}

4765
demo/fullcalendar.js 100644

Plik diff jest za duży Load Diff

119
demo/index.php 100644
Wyświetl plik

@ -0,0 +1,119 @@
<?php
require_once('../SG_iCal.php');
function dump_t($x) {
echo "<pre>".print_r($x,true)."</pre>";
}
$ICS = "basic.ics";
$ical = new SG_iCalReader($ICS);
$query = new SG_iCal_Query();
//$evts = $ical->getEvents();
$evts = $query->Between($ical,strtotime('20100901'),strtotime('20101131'));
$data = array();
foreach($evts as $id => $ev) {
$jsEvt = array(
"id" => ($id+1),
"title" => $ev->getProperty('summary'),
"start" => $ev->getStart(),
"end" => $ev->getEnd(),
"allDay" => false
);
$data[] = $jsEvt;
if (isset($ev->recurrence)) {
$count = 1;
$start = $ev->getStart();
$freq = new SG_iCal_Freq($ev->recurrence->rrule, $start);
while (($next = $freq->nextOccurrence($start)) > 0 ) {
if (!$next or $count >= 200) break;
$count++;
$start = $next;
$jsEvt["start"] = $start;
$jsEvt["end"] = $start + $ev->getDuration();
$data[] = $jsEvt;
}
}
}
//dump_t($data);
$events = "events:".json_encode($data).',';
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Fullcalendar iCal Loader</title>
<link rel="stylesheet" type="text/css" href="fullcalendar.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="fullcalendar.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
year: 2010,
month: 9-1,
// US Holidays
//events: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
<?=$events ?>
eventClick: function(event) {
// opens events in a popup window
window.open(event.url, 'gcalevent', 'width=700,height=600');
return false;
},
loading: function(bool) {
if (bool) {
$('#loading').show();
}else{
$('#loading').hide();
}
}
});
});
</script>
<style type='text/css'>
body div {
text-align: center;
}
body {
font-size: 14px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
div#loading {
position: absolute;
top: 5px;
right: 5px;
}
div#calendar {
width: 900px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="loading" style="display:none;">loading...</div>
<div id="calendar"></div>
</body>
</html>