Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dtend for full day events should be on the next day at midnight #128

Merged
merged 1 commit into from
May 8, 2024
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
9 changes: 8 additions & 1 deletion src/Components/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ public function startsAt(DateTimeInterface $starts, bool $withTime = true): Even

public function endsAt(DateTimeInterface $ends, bool $withTime = true): Event
{
$this->ends = DateTimeValue::create($ends, $withTime);
if ($this->isFullDay) {
// The DTEND is the non-inclusive end of the event.
$ends = $ends->modify('+1 day');
$this->ends = DateTimeValue::create($ends, false);
} else {
$this->ends = DateTimeValue::create($ends, $withTime);
}


return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ UID:uuid_2
DTSTAMP:20190306T150000Z
SUMMARY:Laracon online
DTSTART;VALUE=DATE:20190306
DTEND;VALUE=DATE:20190306
DTEND;VALUE=DATE:20190307
END:VEVENT
END:VCALENDAR
Loading