feat(helpers): add formatTime

This commit is contained in:
Yoga Pangestu 2025-09-29 11:44:11 +07:00
parent 32468f9e8c
commit 04f936ef08

View File

@ -9,6 +9,13 @@ function formatDate(?string $date = null, ?string $format = 'l, d M Y')
}
}
if (! function_exists('formatTime')) {
function formatTime(?string $time = null, ?string $format = 'H:i')
{
return ! $time ? '-' : Carbon::parse($time)->format($format);
}
}
if (! function_exists('formatDateTime')) {
function formatDateTime(string $dateTime)
{