2010-05-23 02:30:16 +02:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel='stylesheet' type='text/css' href='../examples/redmond/theme.css' />
|
|
|
|
<script type='text/javascript' src='loader.js'></script>
|
|
|
|
<script type='text/javascript'>
|
|
|
|
|
2010-05-29 07:11:26 +02:00
|
|
|
var date = new Date();
|
|
|
|
var d = date.getDate();
|
|
|
|
var m = date.getMonth();
|
|
|
|
var y = date.getFullYear();
|
|
|
|
|
|
|
|
var calendar;
|
|
|
|
|
2010-05-23 02:30:16 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
2010-05-29 07:11:26 +02:00
|
|
|
calendar = $('#calendar').fullCalendar({
|
2010-05-23 02:30:16 +02:00
|
|
|
header: {
|
|
|
|
left: 'prev,next today',
|
|
|
|
center: 'title',
|
|
|
|
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
|
|
|
|
},
|
|
|
|
//defaultView: 'agendaWeek',
|
2010-07-06 01:07:40 +02:00
|
|
|
|
|
|
|
//firstDay: 1,
|
2010-05-23 02:30:16 +02:00
|
|
|
//isRTL: true,
|
2010-05-29 07:11:26 +02:00
|
|
|
//minTime: 7,
|
|
|
|
//weekends: false,
|
|
|
|
//allDaySlot: false,
|
2010-07-06 01:07:40 +02:00
|
|
|
|
2010-05-23 02:30:16 +02:00
|
|
|
selectable: true,
|
2010-07-04 03:00:38 +02:00
|
|
|
/*
|
|
|
|
selectable: {
|
|
|
|
month: false,
|
|
|
|
agenda: true
|
|
|
|
},
|
|
|
|
*/
|
2010-07-06 01:07:40 +02:00
|
|
|
|
|
|
|
selectHelper: true,
|
2010-05-29 07:11:26 +02:00
|
|
|
/*
|
|
|
|
selectHelper: function(start, end) {
|
|
|
|
return $("<div style='background:red' />").text(start+' '+end);
|
|
|
|
},
|
|
|
|
*/
|
2010-07-06 01:07:40 +02:00
|
|
|
|
2010-05-23 02:30:16 +02:00
|
|
|
//unselectAuto: false,
|
|
|
|
//unselectCancel: '.fc',
|
2010-07-06 01:07:40 +02:00
|
|
|
|
|
|
|
select: function(start, end, allDay, ev) {
|
2010-05-23 02:30:16 +02:00
|
|
|
console.log(
|
|
|
|
'---- selection ----\n' +
|
|
|
|
'start: ' + start + '\n' +
|
2010-05-29 07:11:26 +02:00
|
|
|
'end: ' + end + '\n' +
|
2010-05-23 02:30:16 +02:00
|
|
|
'allDay: ' + allDay
|
|
|
|
);
|
2010-07-06 01:07:40 +02:00
|
|
|
if (ev) {
|
|
|
|
//console.log('select mouse: ' + ev.pageX + ', ' + ev.pageY);
|
|
|
|
}
|
2010-05-23 02:30:16 +02:00
|
|
|
},
|
2010-07-06 01:07:40 +02:00
|
|
|
unselect: function(ev) {
|
2010-05-23 02:30:16 +02:00
|
|
|
console.log('unselect');
|
2010-07-06 01:07:40 +02:00
|
|
|
if (ev) {
|
|
|
|
//console.log('unselect mouse: ' + ev.pageX + ', ' + ev.pageY);
|
|
|
|
}
|
2010-05-23 02:30:16 +02:00
|
|
|
},
|
|
|
|
dayClick: function(date, allDay) {
|
2010-05-29 07:11:26 +02:00
|
|
|
console.log('DAYCLICK', date, allDay);
|
2010-05-23 02:30:16 +02:00
|
|
|
console.log(this);
|
|
|
|
},
|
|
|
|
editable: true,
|
|
|
|
events: [
|
|
|
|
{
|
|
|
|
title: 'All Day Event',
|
|
|
|
start: new Date(y, m, 1)
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Long Event',
|
|
|
|
start: new Date(y, m, d-5, 5, 0),
|
|
|
|
end: new Date(y, m, d-2, 2, 0),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 999,
|
|
|
|
title: 'Repeating Event',
|
|
|
|
start: new Date(y, m, d-3, 16, 0),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 999,
|
|
|
|
title: 'Repeating Event',
|
|
|
|
start: new Date(y, m, d+4, 16, 0),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Meeting',
|
|
|
|
start: new Date(y, m, d, 10, 30),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Lunch',
|
|
|
|
start: new Date(y, m, d, 12, 5),
|
|
|
|
end: new Date(y, m, d, 14, 43),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Birthday Party',
|
|
|
|
start: new Date(y, m, d+1, 19, 0),
|
|
|
|
end: new Date(y, m, d+1, 22, 30),
|
|
|
|
allDay: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Click for Google',
|
|
|
|
start: new Date(y, m, 28),
|
|
|
|
end: new Date(y, m, 29),
|
|
|
|
url: 'http://google.com/'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2010-05-29 07:11:26 +02:00
|
|
|
|
2010-05-23 02:30:16 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<style type='text/css'>
|
|
|
|
|
|
|
|
body {
|
|
|
|
font-size: 13px;
|
|
|
|
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
#calendar {
|
|
|
|
width: 900px;
|
2010-05-29 07:11:26 +02:00
|
|
|
margin: 40px auto;
|
2010-05-23 02:30:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2010-05-29 07:11:26 +02:00
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d-1), new Date(y, m, d-1), true)">1day, allday</button>
|
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d-1))">1day, noend, noallday</button>
|
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d-1), null, false)">1day, noend, allday=false</button>
|
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d, 5, 15), new Date(y, m, d, 15, 30), false)">1day, timed</button>
|
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d-2), new Date(y, m, d), true)">3day, allday</button>
|
|
|
|
<button onclick="calendar.fullCalendar('select', new Date(y, m, d-1, 5, 15), new Date(y, m, d+1, 15, 30), false)">3day, timed</button>
|
|
|
|
<button onclick="calendar.fullCalendar('unselect')">unselect</button>
|
2010-05-23 02:30:16 +02:00
|
|
|
<div id='calendar'></div>
|
|
|
|
</body>
|
|
|
|
</html>
|