Sin e this is the thread that comes up when googling this error, I’d like to add for anybody else who’s encountering it that this same error seems to come up on extensions/igniterlabs/schedulepro/models/ScheduleOverride.php:256 if you’re using the “Schedule Special Days” extension on php 8.0.
If you get an error that looks like
Error: Call to undefined method DateTime::toDateString()
in <your_site>/extensions/igniterlabs/schedulepro/models/ScheduleOverride.php:256
The quick fix is to replace
L256
$ranges[$dateTime->toDateString()] = $range;
with
$ranges[Carbon::instance($dateTime)->toDateString()] = $range;