1

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.

Jonnix
  • 4,121
  • 1
  • 30
  • 31
user8325392
  • 43
  • 1
  • 5
  • 1
    Could you link to some documentation? Confused about `dow` and `dayOfWeek`.... That just wishful thinking or did something suggest that was an option? I'm looking now at the 'repeating event' here: https://mdbootstrap.com/plugins/jquery/full-calendar/#dynamic-events nothing auto magic - just same static JSON repeated with shared/common `ID` assignment. – ficuscr Jul 23 '19 at 20:33
  • Sure! This link suggests using daysOfWeek: https://fullcalendar.io/docs/recurring-events , And this link suggests dow: https://stackoverflow.com/questions/15161654/recurring-events-in-fullcalendar – user8325392 Jul 23 '19 at 20:35
  • Jeez, Trying to view source code and I'm stuck on page where they want to sell me the plugin for $9. These folks are charging for this, I assume they then provide support? With out source code or decent documentation I am just speculating. – ficuscr Jul 23 '19 at 20:48
  • I mean is this thing https://mdbootstrap.com/products/jquery-full-calendar/ the same as this https://fullcalendar.io/docs/recurring-events (and specifically v4)? – ficuscr Jul 23 '19 at 20:49
  • I'm not sure, I downloaded the plugin from mdbootstrap, and as far as I can tell the documentation is basically non existent and the support is terrible – user8325392 Jul 23 '19 at 21:04
  • Yeah, I'm not certain if they are the same, names are not identical, just similar. They certainly do look similar. Could be same thing, different version. Sorry I'm not sure what else to offer. Perhaps unobfuscate their source code and look for occurrences of `daysOfWeek`? If none... likely it's not implemented. – ficuscr Jul 23 '19 at 21:10
  • From your code sample above you seem to be using version 3 or below, because as of version 4 fullCalendar is no longer created using jQuery. The syntax to initialise the calendar is quite different. If you upgrade to version 4 you get much better support for recurring events – ADyson Jul 23 '19 at 21:49
  • P.S. I'm not really sure what advantage you get from using this MDBootstrap product over just using fullCalendar as it comes, directly. You can plug a Bootstrap theme into it, for presentation purposes - see https://fullcalendar.io/docs/theming. – ADyson Jul 23 '19 at 22:09
  • Is there a different plugin I can use that automatically takes care of creating events? – user8325392 Jul 23 '19 at 22:18
  • what do you mean "automatically creating events", exactly? How are you creating the events now? All I see in your sample above is a static file full of events. Were they somehow created "automatically"? If so, that isn't really anything to do with fullCalendar as far as I can tell. – ADyson Jul 23 '19 at 22:45

0 Answers0