The formatDate() helper method now returns an empty strin, if the input date is

null. As yet it returned the current date.
This commit is contained in:
Lukas Halbritter
2018-10-10 15:03:29 +02:00
parent 960e1b0e16
commit 5b2e5f5fb9
+4
View File
@@ -72,6 +72,10 @@ function swapComma(string $floatString) {
*/ */
function formatDate($date, $format='d.m.Y') function formatDate($date, $format='d.m.Y')
{ {
if (is_null($date)) {
return '';
}
return Carbon\Carbon::parse($date)->format($format); return Carbon\Carbon::parse($date)->format($format);
} }