refactor(helpers): menjadikan parameter formatDateTime menjadi nullable
This commit is contained in:
parent
cdab6e4e26
commit
58314437d8
@ -17,9 +17,10 @@ function formatTime(?string $time = null, ?string $format = 'H:i')
|
||||
}
|
||||
|
||||
if (! function_exists('formatDateTime')) {
|
||||
function formatDateTime(string $dateTime)
|
||||
function formatDateTime(?string $dateTime = null)
|
||||
{
|
||||
return Carbon::parse($dateTime)->translatedFormat('l, d M Y H:i:s');
|
||||
|
||||
return ! $dateTime ? '-' : Carbon::parse($dateTime)->translatedFormat('l, d M Y H:i:s');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user