Files
fullcalendar/tests/droppable_resourceView.html
2014-04-09 14:12:36 +01:00

108 lines
3.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<link href='../build/out/fullcalendar.css' rel='stylesheet' />
<link href='../build/out/fullcalendar.print.css' rel='stylesheet' media='print' />
<script src='../build/out/jquery.js'></script>
<script src='../build/out/jquery-ui.js'></script>
<script src='../build/out/fullcalendar.js'></script>
<script>
$(document).ready(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
defaultView: 'resourceDay',
editable: true,
droppable: true,
drop: function (dt, allDay, ev, ui, view) {
console.log('drop', dt, allDay, ev);
},
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
},
resources: [{ 'id': 'resource1', 'name': 'Resource 1' }, { 'id': 'resource2', 'name': 'Resource 2' }, { 'id': 'resource3', 'name': 'Resource 3' }],
events: [
{
title: 'R1: breakfast',
start: new Date(y, m, d, 09, 00),
end: new Date(y, m, d, 09, 30),
allDay: false,
resources: ['resource1']
},
{
title: 'R1: All day',
start: new Date(y, m, d, 08, 30),
end: new Date(y, m, d, 09, 00),
allDay: true,
resources: 'resource1'
},
{
title: 'R1 & R2: Lunch',
start: new Date(y, m, d, 12, 30),
end: new Date(y, m, d, 13, 00),
allDay: false,
resources: ['resource1', 'resource2']
}
]
});
$('.external-event').draggable({
revert: true,
revertDuration: 0,
zIndex: 999
});
});
</script>
<style>
body {
margin-top: 40px;
text-align: center;
font-size: 13px;
font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
}
#calendar {
width: 900px;
float: left;
}
#external-events {
position: relative;
left: 50px;
text-align: left;
float: left;
width: 140px;
padding: 10px;
border: 1px solid #aaa;
background: #ccc;
}
.external-event {
height: 20px;
line-height: 20px;
color: #fff;
background: blue;
margin-bottom: 10px;
padding-left: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<div id='calendar'></div>
<div id='external-events'>
<div class='external-event'>Draggable 1</div>
<div class='external-event'>Draggable 2</div>
</div>
</body>
</html>