Recurring Events – FullCalendar

I have been developing, for grins, a job scheduling calendar for an imaginary landscaping company using FulllCalendar with a WordPress plugin as the backend. One of the more common problems encountered is recurring events. First issue is an interface for the user to define the recurrences and second is processing them.

From my perspective recurrences are a combination of a pattern and an interval. Perhaps there is a case for a hybrid of the two too.

Thus a recurrence can be defined in terms of months of the year (moy), weeks of the month (wom), and days of the week (dow), An example is Thanksgiving Day; “Every year the last Thursday of November”, moy = November, wom = last and finally the dow = Thursday.

Another common recurrence is Christmas which also occurs annually on the 25th of December or day 25 of the month of December (dom) 

We can use these arrays to define the recurrences

  • moy array(0..11)  of bool
  • dom array(0..30) of bool
  • wom array(0..4) of bool note array[4] set alone (0001) indicates the last dow for the month.
  • dow array(0..6) of bool

Next adding an interval unit array(0..3) for days,weeks, and months coupled with a multiplier value we can round out the necessary elements to define recurrences.

The following views show the user interface to define recurring events;

repeat-1.png

This above is the default view expressing the event start date. This a pattern that does not have an explicit interval.

repeat-2.png

This is a weekly interval recurring event view where the days of the week can be set. Thus the week can have a pattern for the days of the week.

repeat-3.png

This is an event with a monthly occurrence where the weeks of the months and days of the month may be set.

repeat-4.png

This is another event with a monthly occurrence but here the dates of the month may be selected.

Comments are closed.