Skip to content

feat: expose DAV Connector calendars via OCP Calendar ICalendarProvider#85

Open
stephan1827 wants to merge 2 commits into
nextcloud:mainfrom
stephan1827:feat/calendar-provider
Open

feat: expose DAV Connector calendars via OCP Calendar ICalendarProvider#85
stephan1827 wants to merge 2 commits into
nextcloud:mainfrom
stephan1827:feat/calendar-provider

Conversation

@stephan1827

Copy link
Copy Markdown
Contributor

Summary

  • Registers a CalendarProvider implementing OCP\Calendar\ICalendarProvider so that synced external calendars appear in the Nextcloud dashboard widget and calendar search
  • Adds CalendarImpl wrapping each event collection as an OCP\Calendar\ICalendar instance, backed by the local DB
  • The search() method applies time-range filtering via the existing EventStore/RangeDate infrastructure and parses stored ICS data with Sabre VObject to return the format expected by IManager consumers

Previously, DAV Connector calendars were only accessible via the CalDAV/Sabre plugin and were invisible to OCP\Calendar\IManager::getCalendarsForPrincipal() — meaning the dashboard widget, calendar search, and any other IManager consumer could not see them.

Test plan

  • Connect an external CalDAV account via DAV Connector and run a harmonization
  • Open the Nextcloud dashboard — the Calendar widget should now show upcoming events from the synced calendars
  • Verify that the Nextcloud Calendar app search also finds events from the external calendars

🤖 Generated with Claude Code

@SebastianKrupinski

Copy link
Copy Markdown
Collaborator

Hi Stephan,

You need to rebase this, PR to the latest main, you have unrelated commits and changes in this PR.

@stephan1827 stephan1827 force-pushed the feat/calendar-provider branch from 766b097 to d9f37ea Compare June 26, 2026 10:33
@stephan1827

Copy link
Copy Markdown
Contributor Author

Hi Stephan,

You need to rebase this, PR to the latest main, you have unrelated commits and changes in this PR.

Done, you have to merge this first before I can rebase #86 because there are some dependencies.

@stephan1827 stephan1827 force-pushed the feat/calendar-provider branch from d9f37ea to 6dedd8e Compare June 26, 2026 11:51
@stephan1827

Copy link
Copy Markdown
Contributor Author

Lets hold off on this PR, I found a bug that I have to fix first, and I need to do more testing.

Registers CalendarProvider so DAV Connector calendars appear in Nextcloud's
dashboard calendar widget and search via ICalendarManager.

CalendarProvider returns [] during CalDAV requests (/remote.php/dav) to avoid
duplicating the ExternalCalendar entries that the Sabre DAV plugin already
provides in the user's calendar home. In dashboard and search contexts the full
calendar list is returned.

CalendarImpl.getUri() returns a slash-free identifier (davc_{id}) because
Nextcloud wraps it into app-generated--dav-wrapper--{uri} as a CalDAV resource
name and path parsing splits on '/'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: stephan1827 <stephan@stricker.cloud>
@stephan1827 stephan1827 force-pushed the feat/calendar-provider branch from 6dedd8e to e043f60 Compare June 26, 2026 13:16
@stephan1827

Copy link
Copy Markdown
Contributor Author

ok, should be fine now, there are still some minor issues but those do not affect this repo

- EventStore: add case 5 to range filter so recurring events with a base
  occurrence before the query window are still fetched; expand() in
  CalendarImpl then generates only instances within the window
- CalendarImpl: skip expanded instances whose DTSTART is before the range
  start (DATE-only events are compared by calendar date, not timestamp,
  so today's all-day events are never skipped)
- CalendarImpl: shift VALUE=DATE DTSTART to 23:59:59 UTC so the
  CalendarWidget's timestamp filter passes for all-day events throughout
  the day
- CalendarImpl: remove limit from search results; the dashboard widget
  collects all calendars and applies its own display limit after sorting

Signed-off-by: Stephan Stricker <stephan@stricker.cloud>
Signed-off-by: stephan1827 <stephan@stricker.cloud>
@stephan1827 stephan1827 force-pushed the feat/calendar-provider branch from e043f60 to d32586f Compare June 26, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants