I am creating a web app using PHP, JQuery and FullCalendar (Version: MDB Full Calendar 4.8.6). I want to allow users to enter event information into an html form (Event Name, Event Description, Start Day/Time, End Day/Time, and MOST IMPORTANTLY whether this event occurs weekly, bi-weekly or monthly), then store this information in a JSON file.
I then need a JQuery function to populate the calendar based on the user's input.
I have tried to use {dow: [ 1, 4 ]
} in the JSON and it does not seem to work. I have also tried {daysOfWeek: [1, 4]
} and that does not appear to work either. Am I doing something wrong? How can I configure the JSON so that I can control an event to recur during certain days of the week or month?
var dateInput;
$(document).ready(function () {
$('#calendar').fullCalendar({
defaultView: 'month',
defaultDate: '<?php echo date("Y-m-d"); ?>',
eventRender: function (eventObj, $el) {
$el.popover({
title: eventObj.title,
content: eventObj.description,
trigger: 'hover',
placement: 'top',
container: 'body'
});
},
events: [<?php require('test.json'); ?>]
})
Then the JSON file:
{
title: 'Event 1',
description: 'Events are so great',
start: '2019-07-23T16:00:00',
end: '2020-07-23T20:00:00',
dow: [ 1, 4 ]
},
{
title: 'Long Event',
description: 'description for Long Event',
start: '2018-10-07',
end: '2018-11-10'
},
{
id: 46,
title: 'Repeating Event',
description: 'description for Repeating Event',
start: '2019-07-22T16:00:00',
},
{
id: 999,
title: 'Repeating Event',
description: 'description for Repeating Event',
start: '2018-11-16T16:00:00'
},
{
title: 'Conference',
description: 'description for Conference',
start: '2018-11-11',
end: '2018-11-13'
},
{
title: 'Meeting',
description: 'description for Meeting',
start: '2018-11-12T10:30:00',
end: '2018-11-12T12:30:00'
},
{
title: 'Lunch',
description: 'description for Lunch',
start: '2018-11-12T12:00:00'
},
{
title: 'Meeting',
description: 'description for Meeting',
start: '2018-11-12T14:30:00'
},
{
title: 'Birthday Party',
description: 'description for Birthday Party',
start: '2018-11-13T07:00:00'
},
{
title: 'Click for Google',
description: 'description for Click for Google',
url: 'http://google.com/',
start: '2018-11-28'
},
Thank you in advance for any help/advice, I am pretty frustrated after working on this for a few days now.