Skip to content

Commit

Permalink
fix endtimes for single day events (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell authored May 26, 2022
1 parent f58ff16 commit de01632
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Types/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __get(string $key): mixed

public function endTime(): string
{
return $this->end_time ?? now()->endOfDay();
return $this->end_time ?? now()->endOfDay()->toTimeString();
}

public function hasEndTime(): bool
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/SingleDayEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public function endIsEndOfDayWhenNoEndTime()
]);

$event = EventFactory::createFromEntry($entry);

$this->assertEquals('23:59:59', $event->endTime());
$nextOccurrences = $event->nextOccurrences();

$this->assertFalse($nextOccurrences[0]->has_end_time);
Expand Down

0 comments on commit de01632

Please sign in to comment.