aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/lib/Recur/EventIterator.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-03-29 11:42:53 +0200
committerMario Vavti <mario@mariovavti.com>2022-03-29 11:42:53 +0200
commit0784cd593a39a4fc297e8a82f7e79bc8019a0868 (patch)
tree22182afb37cf460f8208fff9d276a0672add3185 /vendor/sabre/vobject/lib/Recur/EventIterator.php
parent0e2e9321025f87fe9587f3d183adaea6185e4e20 (diff)
parent9c5d2ee5630dd7033904039dcd1e92db8821b644 (diff)
downloadvolse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.gz
volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.bz2
volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.zip
Merge branch '7.2RC'7.2
Diffstat (limited to 'vendor/sabre/vobject/lib/Recur/EventIterator.php')
-rw-r--r--vendor/sabre/vobject/lib/Recur/EventIterator.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/vendor/sabre/vobject/lib/Recur/EventIterator.php b/vendor/sabre/vobject/lib/Recur/EventIterator.php
index e42ca1360..61f05d7de 100644
--- a/vendor/sabre/vobject/lib/Recur/EventIterator.php
+++ b/vendor/sabre/vobject/lib/Recur/EventIterator.php
@@ -198,6 +198,7 @@ class EventIterator implements \Iterator
*
* @return DateTimeImmutable
*/
+ #[\ReturnTypeWillChange]
public function current()
{
if ($this->currentDate) {
@@ -229,9 +230,13 @@ class EventIterator implements \Iterator
if (!$this->valid()) {
return;
}
- $end = clone $this->currentDate;
+ if ($this->currentOverriddenEvent && $this->currentOverriddenEvent->DTEND) {
+ return $this->currentOverriddenEvent->DTEND->getDateTime($this->timeZone);
+ } else {
+ $end = clone $this->currentDate;
- return $end->modify('+'.$this->eventDuration.' seconds');
+ return $end->modify('+'.$this->eventDuration.' seconds');
+ }
}
/**
@@ -281,6 +286,7 @@ class EventIterator implements \Iterator
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function key()
{
// The counter is always 1 ahead.
@@ -293,6 +299,7 @@ class EventIterator implements \Iterator
*
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function valid()
{
if ($this->counter > Settings::$maxRecurrences && -1 !== Settings::$maxRecurrences) {
@@ -304,7 +311,10 @@ class EventIterator implements \Iterator
/**
* Sets the iterator back to the starting point.
+ *
+ * @return void
*/
+ #[\ReturnTypeWillChange]
public function rewind()
{
$this->recurIterator->rewind();
@@ -327,7 +337,10 @@ class EventIterator implements \Iterator
/**
* Advances the iterator with one step.
+ *
+ * @return void
*/
+ #[\ReturnTypeWillChange]
public function next()
{
$this->currentOverriddenEvent = null;