Best way to deal with reoccurring events

Hi, I'm making an events app and I have all the API endpoints sorted (query all records, get record, add event, edit event) but I need to add a reoccurring aspect to some events.

A user might chose to make their event weekly or monthly or first Thursday of the month or 3rd Monday of every month etc.

What would be the best way to implement this? Right now I'm thinking of having:

Reoccurring boolean. If false then treat the event as usual and GET date as usual.

If true then the frequency of the event as a string (weekly, 1st [day] of the month, 2nd [day] of the month etc)
and

Day of the week as a string.

With this I can then run a calculation on the Query and Get records so it doesn't just look at the date field but also works out if the reoccurring event lands on the searched day too.

Is this the best way to achieve this or am I missing something obvious?

Thanks so much,

Sammy

1 reply