Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .patches/sabre-vobject-rdate.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
From 099a37744a3aaf368bdd339f9c01e34553e8828e Mon Sep 17 00:00:00 2001
From: SebastianKrupinski <[email protected]>
Date: Wed, 19 Nov 2025 19:19:32 -0500
Subject: [PATCH] fix: use RDATE in time range check and use all instances

Signed-off-by: SebastianKrupinski <[email protected]>
---
lib/Component/VEvent.php | 2 +-
lib/Recur/EventIterator.php | 6 ++++-
tests/VObject/Component/VEventTest.php | 35 ++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/lib/Component/VEvent.php b/lib/Component/VEvent.php
index e29e56322..6ca196d66 100644
--- a/lib/Component/VEvent.php
+++ b/lib/Component/VEvent.php
@@ -41,7 +41,7 @@ class VEvent extends VObject\Component
*/
public function isInTimeRange(\DateTimeInterface $start, \DateTimeInterface $end): bool
{
- if ($this->RRULE) {
+ if ($this->RRULE || $this->RDATE) {
try {
$it = new EventIterator($this, null, $start->getTimezone());
} catch (NoInstancesException $e) {
diff --git a/lib/Recur/EventIterator.php b/lib/Recur/EventIterator.php
index 2c93bcf4e..79a070ee4 100644
--- a/lib/Recur/EventIterator.php
+++ b/lib/Recur/EventIterator.php
@@ -164,8 +164,12 @@ public function __construct($input, ?string $uid = null, ?\DateTimeZone $timeZon
}

if (isset($this->masterEvent->RDATE)) {
+ $rdateValues = [];
+ foreach ($this->masterEvent->RDATE as $rdate) {
+ $rdateValues = array_merge($rdateValues, $rdate->getParts());
+ }
$this->recurIterator = new RDateIterator(
- $this->masterEvent->RDATE->getParts(),
+ $rdateValues,
$this->startDate
);
} elseif (isset($this->masterEvent->RRULE)) {
3 changes: 3 additions & 0 deletions composer.patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
},
"sabre/dav": {
"Check for instanceof INode instead of Node": ".patches/check-for-instanceof-INode-instead-of-Node-1595.patch"
},
"sabre/vobject": {
"fix use RDATE in time range check and use all instances": ".patches/sabre-vobject-rdate.patch"
}
}
}
7 changes: 7 additions & 0 deletions sabre/vobject/PATCHES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
Patches applied to this directory:

fix use RDATE in time range check and use all instances
Source: .patches/sabre-vobject-rdate.patch


2 changes: 1 addition & 1 deletion sabre/vobject/lib/Component/VEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class VEvent extends VObject\Component
*/
public function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end)
{
if ($this->RRULE) {
if ($this->RRULE || $this->RDATE) {
try {
$it = new EventIterator($this, null, $start->getTimezone());
} catch (NoInstancesException $e) {
Expand Down
6 changes: 5 additions & 1 deletion sabre/vobject/lib/Recur/EventIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@ public function __construct($input, $uid = null, ?DateTimeZone $timeZone = null)
}

if (isset($this->masterEvent->RDATE)) {
$rdateValues = [];
foreach ($this->masterEvent->RDATE as $rdate) {
$rdateValues = array_merge($rdateValues, $rdate->getParts());
}
$this->recurIterator = new RDateIterator(
$this->masterEvent->RDATE->getParts(),
$rdateValues,
$this->startDate
);
} elseif (isset($this->masterEvent->RRULE)) {
Expand Down