Skip to content

Add Support for Recurrence In Calendar Collection#8799

Draft
BeatLink wants to merge 3 commits intoTriliumNext:mainfrom
BeatLink:main
Draft

Add Support for Recurrence In Calendar Collection#8799
BeatLink wants to merge 3 commits intoTriliumNext:mainfrom
BeatLink:main

Conversation

@BeatLink
Copy link

This PR enables the calendar collection to support recurrences.

If a child note of a calendar collection has a #recurrence label with an ICAL recurrence string e.g. FREQ=WEEKLY;INTERVAL=5; it will repeat multiple times in the calendar view based on its recurrence.

Normally the FullCalendar recurrence plugin requires a recurrence string with DTSTART, but this is not included in the string, in favor of generating the DTSTART value based on the already existing #startDate label.

Also, fullCalendar requires a duration property to be added when using recurrence, otherwise it would treat it as an all day event. This is solved by dynamically calculating and setting the duration property from the difference of the start and end date if the latter exists.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 22, 2026
@dosubot
Copy link

dosubot bot commented Feb 22, 2026

Related Documentation

Checked 0 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @BeatLink, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the calendar collection functionality by introducing support for recurring events. It allows users to define repeating events using iCalendar RRULE strings, which are dynamically processed to display multiple instances in the calendar view. The changes involve integrating a new FullCalendar plugin, adapting event data structures, and updating documentation to guide users on how to leverage this new feature.

Highlights

  • Recurrence Support: Introduced the ability for calendar events to support recurrence based on an iCalendar RRULE string provided via a new #recurrence label.
  • FullCalendar Integration: Integrated the @fullcalendar/rrule plugin to handle recurring events within the calendar view.
  • Dynamic DTSTART Generation: Implemented logic to dynamically generate the DTSTART property for recurring events using the existing #startDate and #startTime labels, as the #recurrence label does not include it.
  • Event Duration Calculation: Added functionality to calculate and set the duration property for recurring events based on the difference between #startDate and #endDate, preventing them from being treated as all-day events.
  • Documentation Update: Updated the user guide documentation to include details about the new #recurrence label and its usage.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/client/package.json
    • Added "@fullcalendar/rrule" as a dependency.
  • apps/client/src/widgets/collections/calendar/event_builder.ts
    • Modified the "Event" interface to include an optional "recurrence" property.
    • Updated "buildEvents" to extract the "recurrence" label value from notes.
    • Modified "buildEvent" to accept and process the "recurrence" property.
    • Implemented logic to construct the "rrule" string with "DTSTART" and calculate "duration" for recurring events.
  • apps/client/src/widgets/collections/calendar/index.tsx
    • Dynamically imported and added the "@fullcalendar/rrule" plugin to the list of FullCalendar plugins.
  • apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Calendar.html
    • Added a new row to the HTML table documenting the "#recurrence" label.
  • docs/User Guide/User Guide/Collections/Calendar.md
    • Added a new row to the Markdown table documenting the "#recurrence" label.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds support for recurring events in the calendar collection by integrating the @fullcalendar/rrule package. The changes involve updating dependencies, modifying the event building logic to handle recurrence rules, and updating documentation. My review includes one critical comment to fix a bug where recurring events would not work correctly if they had an end date, and also to improve the readability of the duration calculation logic.

Replace end with duration if recurrence set. Make duration calculation clearer

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@BeatLink
Copy link
Author

Closes #8798

@BeatLink
Copy link
Author

Closes #7114

@BeatLink
Copy link
Author

@eliandoran Hey, I was wondering if you could take a look at this.

Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems fine.

But there is a critical issue: Using an invalid value like FREQ=WEEKLY;INTERVAL=1;BYDAY= crashes the calendar with Invalid weekday string, and the calendar becomes unusable. Report invalid values via toast, without crashing and without affecting other valid calendar events.

Make sure to write tests for this scenario. Note that the event builder is UI-agnostic, so the toast should be handled in the consumer of the event builder.

Comment on lines +124 to +133
if (recurrence) {
delete eventData.end;
eventData.rrule = `DTSTART:${startDate.replace(/[-:]/g, "")}\n${recurrence}`;
if (endDate){
const diffMs = new Date(endDate).getTime() - new Date(startDate).getTime();
const hours = Math.floor(diffMs / 3600000);
const minutes = Math.floor((diffMs / 60000) % 60);
eventData.duration = `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests. The event builder has pretty decent coverage and I would like to keep it that way.

| `#endDate` | Similar to `startDate`, mentions the end date if the event spans across multiple days. The date is inclusive, so the end day is also considered. The attribute can be missing for single-day events. |
| `#startTime` | The time the event starts at. If this value is missing, then the event is considered a full-day event. The format is `HH:MM` (hours in 24-hour format and minutes). |
| `#endTime` | Similar to `startTime`, it mentions the time at which the event ends (in relation with `endDate` if present, or `startDate`). |
| `#recurrence` | This is an optional CalDAV `RRULE` string that if present, determines whether a task should repeat or not. Note that it does not include the `DTSTART` attribute, which is derived from the `#startDate` and `#startTime` directly. For examples of valid `RRULE` strings see [https://icalendar.org/rrule-tool.html](https://icalendar.org/rrule-tool.html) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it's good that it's mentioned in the attribute reference, an important feature such as recurrence needs its own heading in the Calendar documentation.

The tool provided is decent, but I would also add some concrete examples. Mention also that promoted attributes can be used to define an easy way to input recurrence.

Of course, in the future we ought to have a nice recurrence editor.

@eliandoran eliandoran marked this pull request as draft February 26, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants