From 848cb6ae4caaee14c05f111ae08bee9af3447e45 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 12 Jan 2022 17:55:12 +1100 Subject: [PATCH] Do not translate date if none is present --- app/Utils/Traits/MakesDates.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Utils/Traits/MakesDates.php b/app/Utils/Traits/MakesDates.php index 02cac3cdabef..1ca67e1e0cc1 100644 --- a/app/Utils/Traits/MakesDates.php +++ b/app/Utils/Traits/MakesDates.php @@ -99,6 +99,9 @@ trait MakesDates public function translateDate($date, $format, $locale) { + if(empty($date)) + return ''; + Carbon::setLocale($locale); try {