Calendar - how to repeat an event at regular intervals for a set number of times

I’m currently implementing the in-built calendar to allow users to add a date with an option to make this date recurring at regular intervals (say every 7 days or every 4 weeks or every 1 year) for a specified number of times (recur 2 times or recur 5 times).

The calendar setting has a recurring option but I can only add recurring Start and End dates and these options don’t work correctly for recurring events set to repeat at a regular interval for a specified number of times. I have read documentation and various posts related to the Calendar component, but can’t find a method to implement this particular functionality.

Any help to achieve this type of functionality is greatly appreciated.