Fixes #2509. Check for invalid dates

This commit is contained in:
James Brooks
2017-05-02 08:12:42 +01:00
parent a2026b7d7a
commit ae7c795206
+4 -2
View File
@@ -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');
}
}
/**