Skip to content

Instantly share code, notes, and snippets.

@ahmadwaliesipick
Created April 4, 2018 12:49
Show Gist options
  • Save ahmadwaliesipick/f3f01866004e10c822587800d386d065 to your computer and use it in GitHub Desktop.
Save ahmadwaliesipick/f3f01866004e10c822587800d386d065 to your computer and use it in GitHub Desktop.
Add Button
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,listMonth'
},
eventAfterAllRender: function (view) {
if (view.name == 'month') {
$('.fc-day').each(function () {
$(this).css('position', 'relative');
$(this).append('<a class="add_event_label" `enter code here`style="position:absolute;bottom:0;left:0;right:0;display: block;border-top:1px solid black;font-size:12px;color:#000;text-align:center;cursor:pointer;">(+)Add Event</a>');
});
}
},
defaultDate: '2018-03-12',
navLinks: true, // can click day/week names to navigate views
businessHours: true, // display business hours
editable: true,
dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
events: [
{
title: 'Business Lunch',
start: '2018-03-03T13:00:00',
constraint: 'businessHours',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Meeting',
start: '2018-03-13',
end: '2018-03-13',
rendering: 'background',
color: '#257e4a'
// constraint: 'availableForMeeting', // defined below
},
{
title: 'Conference',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Conference 1',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Conference 2',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Conference 3',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Conference 4',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Conference 5',
start: '2018-03-18',
end: '2018-03-18',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
{
title: 'Party',
start: '2018-03-29T20:00:00',
textColor: '#257e4a',
backgroundColor: 'transparent',
borderColor: 'transparent'
},
// areas where "Meeting" must be dropped
{
id: 'availableForMeeting',
start: '2018-03-11T10:00:00',
end: '2018-03-11T16:00:00',
rendering: 'background',
color: '#257e4a'
},
{
id: 'availableForMeeting',
start: '2018-03-13T10:00:00',
end: '2018-03-13T16:00:00',
rendering: 'background',
color: '#257e4a'
}
],
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment