From ae7c7952067c17880c3c7b35c3f24d946683780a Mon Sep 17 00:00:00 2001 From: James Brooks Date: Tue, 2 May 2017 08:12:42 +0100 Subject: [PATCH] Fixes #2509. Check for invalid dates --- app/Presenters/SchedulePresenter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Presenters/SchedulePresenter.php b/app/Presenters/SchedulePresenter.php index d1c7549c..cfc98a5f 100644 --- a/app/Presenters/SchedulePresenter.php +++ b/app/Presenters/SchedulePresenter.php @@ -206,11 +206,13 @@ class SchedulePresenter extends BasePresenter implements Arrayable /** * Formats the completed_at time ready to be used by bootstrap-datetimepicker. * - * @return string + * @return string|void */ public function completed_at_datetimepicker() { - return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i'); + if ($this->wrappedObject->completed_at !== '0000-00-00 00:00:00') { + return $this->dates->make($this->wrappedObject->completed_at)->format('Y-m-d H:i'); + } } /**