parse purchase date even though it's cast

This commit is contained in:
spencerrlongg 2023-09-20 14:26:49 -05:00
parent 7dab59c98d
commit cbef531811

View file

@ -3,6 +3,7 @@
namespace App\Presenters;
use App\Models\CustomField;
use Carbon\CarbonImmutable;
use DateTime;
/**
@ -429,7 +430,7 @@ class AssetPresenter extends Presenter
public function eol_date()
{
if (($this->purchase_date) && ($this->model->model) && ($this->model->model->eol)) {
return $this->purchase_date->addMonths($this->model->model->eol)->format('Y-m-d');
return CarbonImmutable::parse($this->purchase_date)->addMonths($this->model->model->eol)->format('Y-m-d');
}
}