Complex recurring event – Is there a way

calendaricalschedule

OK, I want to look at my calendar and know when I will be paid. I normally use Apple's Calendar, but I also have access to Microsoft Outlook.

The rules are as follows:

  • I'm paid every month;
  • I'm paid always on the last possible day before the 28th day of the month;
  • I'm paid always on a working day.

Therefore, notwithstanding the bank holidays (public holidays in the UK):

I should always be paid on the 27th, except when it's on a Saturday or Sunday, in which case I'm paid on the previous Friday.

It's pretty simple, really, but for some reason that looks impossible on my calendar:

What do I do here?!

The options for recurring are.. [[first to fifth]|last] [day|weekday|weekend day|[a day of the week]] and nothing else. I cannot specify it must be before the 28th. I can tell it to recur every 27th, but it will be wrong two or three times in a year.

Then I remembered there's a bunch of calendars that can be synchronised online, like webcal.fi, and I read about it and they use a small file format called iCalendar, with extension .ics, but I can't figure out how to make complex recurrence rules. I thought "how do they calculate the recurrence of easter, for example?" and proceeded to look for it. Alas, all the iCal references for easter I found are a bunch of hard-coded dates for each year, no logic involved.

Thus.. my question: Is there any way I can set this event recurrence up? Can it be done? How?

Thank you!

Best Answer

No. You can't create a recurrence for this granular of a rule set.

  • I'm paid every month;
  • I'm paid always on the last possible day before the 28th day of the month;
  • I'm paid always on a working day.

So, to simplify it, you're paid the 27th of every month unless it's a weekend or holiday, then you're paid the previous workday.

Your options are as follows:

  • Schedule a year or two of a monthly recurrences for the 27th then go through the next 12/24 entries and manually fix the ones that fall on a weekend or holiday. This is probably the quickest and most effective method because you can quickly scan your calendar for conflicts.

    Using the calendar below, you can find only 3 instances where the 27th falls on a weekend in less than 30 seconds. Easter being a 4th entry is also simple to modify. It's simply not efficient to code these one-offs.

  • Create a CSV (Excel) file of your pay periods and convert them to .ics.

You're finding hard coded calendars with no logic because it's far easier to make the single change manually than to write the logic for it. Your payroll admin also processes these anomalous events manually. The problem with trying to automate this is...

  1. holiday events vary too much from culture to culture
  2. holiday events in calendars aren't "calculated;" they're event entries like every other event entry (team meeting, dentist appointment, parent/teacher conference, etc.)
  3. holiday events are not all equal. Not all banks/companies will observe all holidays (close).

You could create the code using an opensource ics library to generate the .ics files your particular organization, but you're not going to find this recurrence pattern available in the calendar apps.


2021 Yearly Calendar View