Skip to content

Commit

Permalink
Fixes to the display and render methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
benhall14 committed Oct 30, 2024
1 parent 7c0ad13 commit 4fa17f0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,19 @@ public function stylesheet(bool $print = true): ?string
*
* @param array{color?: string, startDate?: (string|DateTimeInterface), timeInterval?: int, endTime?: string, startTime?: string} $options
*/
public function render(array $options): void
public function display(array $options): void
{
echo $this->stylesheet();
echo $this->render($options);
}

/**
* New Render method that uses options.
*
* @param array{color?: string, startDate?: (string|DateTimeInterface), timeInterval?: int, endTime?: string, startTime?: string} $options
*/
public function render(array $options): void
{
echo 'week' === $this->config->type ? $this->asWeekView($options) : $this->asMonthView($options);
}
}

0 comments on commit 4fa17f0

Please sign in to comment.