63458f397d
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
27 lines
667 B
JavaScript
27 lines
667 B
JavaScript
export function formatTanggal(dateStr) {
|
|
if (!dateStr) return '-'
|
|
const d = new Date(dateStr)
|
|
if (isNaN(d.getTime())) return dateStr
|
|
const months = [
|
|
'Januari',
|
|
'Februari',
|
|
'Maret',
|
|
'April',
|
|
'Mei',
|
|
'Juni',
|
|
'Juli',
|
|
'Agustus',
|
|
'September',
|
|
'Oktober',
|
|
'November',
|
|
'Desember',
|
|
]
|
|
const day = d.getDate()
|
|
const month = months[d.getMonth()]
|
|
const year = d.getFullYear()
|
|
const hours = String(d.getHours()).padStart(2, '0')
|
|
const minutes = String(d.getMinutes()).padStart(2, '0')
|
|
const seconds = String(d.getSeconds()).padStart(2, '0')
|
|
return `${day} ${month} ${year} (${hours}:${minutes}:${seconds})`
|
|
}
|