From 223e94b5881e9e35ebb41ae5d0d4c012bc18c26b Mon Sep 17 00:00:00 2001 From: Mulia Arifandi Nasution Date: Sun, 19 Jul 2020 11:07:08 +0700 Subject: [PATCH] Allow `CarbonImmutable` date This pull request will allow to use `Carbon` or `CarbonImmutable` instance. ```php use Carbon\Carbon; use Carbon\CarbonImmutable; use Spatie\GoogleCalendar\Event; $event = new Event; // Before: Only be able to assign Carbon instance. $event->startDateTime = Carbon::now(); // After: Also be able to assign CarbonImmutable instance. $event->startDateTime = CarbonImmutable::now(); ``` --- src/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Event.php b/src/Event.php index 6fed0d8..424ae02 100644 --- a/src/Event.php +++ b/src/Event.php @@ -223,7 +223,7 @@ protected static function getGoogleCalendar(string $calendarId = null): GoogleCa return GoogleCalendarFactory::createForCalendarId($calendarId); } - protected function setDateProperty(string $name, Carbon $date) + protected function setDateProperty(string $name, CarbonInterface $date) { $eventDateTime = new Google_Service_Calendar_EventDateTime;