From 4fa17f08ee161e07d8654fc9bd51b0849652a883 Mon Sep 17 00:00:00 2001 From: Benjamin Hall Date: Wed, 30 Oct 2024 11:33:35 +0000 Subject: [PATCH] Fixes to the display and render methods. --- src/Calendar.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Calendar.php b/src/Calendar.php index a37d585..881f3b3 100644 --- a/src/Calendar.php +++ b/src/Calendar.php @@ -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); } }