Can't create events occurring every other week

Created on 22 September 2020, over 4 years ago
Updated 2 February 2024, 11 months ago

I want to create a biweekly event (occuring every two weeks) on a specific day of the week (eg. on Tuesdays). The closest I can get is to create a monthly event that occurs, for example, on the second and fourth Tuesday of a month. But that does not solve my problem.

If I have an event I want to populate every other Tuesday, starting on September the 8th, an example list of dates with this criteria would be:

  • September 8th
  • September 22nd
  • October 6th
  • October 20th
  • November 3rd
  • November 17th
  • and so on...

I cannot create an event series that follows this structure. I could create a monthly event with an Event Recurrence Schedule of "Recur on Day of Week" that occurs on the Second and Fourth Tuesday of the month by using the Day Occurrence and Days of the Week fields.
This works fine for the month of September, but since my event needs to be every two weeks, NOT twice a month, functionality breaks once the month of October starts. My event needs to be on October 6th, but because I'm forced to choose an occurrence of weeks the event would populate not on the sixth and twentieth of October but on the thirteenth and twenty-seventh.

I understand that I can create a custom event and manually input all these dates, but this is becoming an undue burden on our site's moderators who have to regularly create events that go well into the future.

If anyone could help with expanding the functionality of the recurring_events module to include regular intervals like every X number of weeks I would highly appreciate it.

✨ Feature request
Status

Active

Version

2.0

Component

Recurring Events (Main module)

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mrweiner

    I suspect that I'll need this functionality, so leaving a note for myself or anybody else who decides they need to hit this -- I don't think it'll be too involved. The instance creation logic is in RecurringEventsFieldTypeInterface::calculateInstances(), implemented in the Drupal\recurring_events\Plugin\Field\FieldType classes. Likely just need to add the integer field (like suggested by @the_glitch) and then use that to modify the generated instances.

    Alternatively, if folks want to implement this themselves, there is hook_recurring_events_event_instances_pre_create_alter(). If you add the integer field yourself, you could pull the value in this hook to filter out the instances before they are created.

  • πŸ‡ΊπŸ‡ΈUnited States mrweiner
  • First commit to issue fork.
Production build 0.71.5 2024