From 229188e0ae03a9c38ba9b73a00aeb631c7be6238 Mon Sep 17 00:00:00 2001 From: Steffen Lange Date: Wed, 31 Jan 2024 14:25:35 +0100 Subject: [PATCH] Fix that DTEND specifies the non-inclusive end --- feiertage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/feiertage.php b/feiertage.php index c02e40e..2d6a970 100644 --- a/feiertage.php +++ b/feiertage.php @@ -54,8 +54,8 @@ class Feiertag { return $this->name; } - public function GetDatum(string $format = 'Ymd') { - return date($format, $this->datum); + public function GetDatum(string $format, string $expr = 'now') { + return date($format, strtotime($expr, $this->datum)); } public function IsGesetzlich() { @@ -90,8 +90,8 @@ class Feiertag { $s = "BEGIN:VEVENT\r\n" . 'UID:' . uniqid(get_class()) . "\r\n" . "DTSTAMP:{$this->GetDatum('Ymd\THis\Z')}\r\n" - . "DTSTART;VALUE=DATE:{$this->GetDatum()}\r\n" - . "DTEND;VALUE=DATE:{$this->GetDatum()}\r\n" + . "DTSTART;VALUE=DATE:{$this->GetDatum('Ymd')}\r\n" + . "DTEND;VALUE=DATE:{$this->GetDatum('Ymd', '+1 day')}\r\n" . 'SUMMARY:' . addcslashes($this->name, ',\\;') . "\r\n" . 'TRANSP:TRANSPARENT' . "\r\n"; if ($this->IsGesetzlich()) {