fix: 🐛 cast dates to datetime

This commit is contained in:
Corentin Huet 2026-10-28 17:35:34 +01:00
parent 6ec164d39a
commit f4ce662e8f

View file

@ -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()
);
}
}