From f4ce662e8f010d5f2a430ccc255f0f101ff8f31d Mon Sep 17 00:00:00 2001 From: Corentin Huet Date: Wed, 28 Oct 2026 17:35:34 +0100 Subject: [PATCH] fix: :bug: cast dates to datetime --- app/Models/Calendrier.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Calendrier.php b/app/Models/Calendrier.php index 5669c9c..da1dee5 100644 --- a/app/Models/Calendrier.php +++ b/app/Models/Calendrier.php @@ -2,6 +2,7 @@ namespace App\Models; +use Carbon\Carbon; use Illuminate\Database\Eloquent\Model; class Calendrier extends Model @@ -54,6 +55,9 @@ class Calendrier extends Model */ public function isPublished(): bool { - return now()->betweenIncluded($this->calendrier_startdate, $this->calendrier_enddate->endOfDay()); + return now()->betweenIncluded( + Carbon::parse($this->calendrier_startdate), + Carbon::parse($this->calendrier_enddate)->endOfDay() + ); } }