fix: menambahkan jam pada helper tanggal
This commit is contained in:
parent
e8a7e7c279
commit
eaed481019
@ -3,10 +3,16 @@
|
||||
use Carbon\Carbon;
|
||||
|
||||
if (! function_exists('formatDateIndo')) {
|
||||
function formatDateIndo($date, $format = 'l, d F Y', $locale = 'id')
|
||||
function formatDateIndo($date)
|
||||
{
|
||||
Carbon::setLocale('id');
|
||||
|
||||
return Carbon::parse($date)->translatedFormat('D, d M Y');
|
||||
$carbonDate = Carbon::parse($date);
|
||||
|
||||
if ($carbonDate->hour !== 0 || $carbonDate->minute !== 0 || $carbonDate->second !== 0) {
|
||||
return $carbonDate->translatedFormat('D, d M Y H:i:s');
|
||||
}
|
||||
|
||||
return $carbonDate->translatedFormat('D, d M Y');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user