When creating a weekly recurring event that has a set number of occurrences, the occurrence occurs an extra time if you start the series on any day except monday.
How to Reproduce:
To Recreate for a weekly event:
-navigate to a resident or community calendar
-Create a new event with the following parameters: “weekly” “repeat every wednesday” “end after 2 ocurrences”
-Refresh the parent page and observe the extra occurrence
To recreate for a monthly event:
- Navigate to the resident/facility calendar
- Create a new event with the following parameters: “Monthly” “on [1] [Wednesday] every [1] month” and “after [2] occurrences”
- View the calendar and notice the extra occurrence
Technical Details:
Here is the code that adds the extra occurrence if it isn’t a weekly event that includes the first day of the week. It looks intentional, but it’s certainly causing an issue.
scheduler.transpose_type(code.join("_"));
repeat = Math.max(1, els["occurences_count"].value);
var transp = ((code[0] == "week" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);
dates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join("_"));