I have designed a calendar which should display the shift start and end date along with the shift timing If an employee is allocated with morning shift from oct 1-oct 7 and if the timing for morning shift is 09:00 -18:00 then the event should be displayed in the calendar from oct 1st to oct 7th for the timing 9-18.Here in my code it created events only based on the dates and it does not considers time
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var form = '';
var today = new Date($.now());
var calendar = $('#calendar').fullCalendar({
slotDuration: '00:15:00', /* If we want to split day time each 15minutes */
minTime: '00:00:00', /* calendar start Timing */
maxTime: '24:00:00', /* calendar end Timing */
defaultView: 'month',
handleWindowResize: true,
height: $(window).height() - 200,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
// right: ''
},
events: [
{
title: 'Morning Shift',
start: new Date('09/25/2018'),
end: new Date('10/05/2018'),
className: 'bg-primary'
},
{
title: 'Night Shift',
start: new Date('09/25/2018'),
end: new Date('10/05/2018'),
className: 'bg-primary'
},
{
title: 'Regular Shift',
start: new Date('09/25/2018'),
end: new Date('10/05/2018'),
className: 'bg-primary'
}
],});