fix: 🐛 cast dates to datetime
This commit is contained in:
parent
6ec164d39a
commit
f4ce662e8f
1 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue