Merge pull request 'efril' (#1) from efril into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2025-08-13 17:12:17 +00:00
13 changed files with 1332 additions and 10 deletions
+15 -1
View File
@@ -34,9 +34,23 @@ export const formatDate = (dateString: any) => {
})
}
export const formatDateDDMMYYYY = (date: Date) => {
export const formatDateDDMMYYYY = (dateString: Date | string) => {
const date = new Date(dateString)
const day = String(date.getDate()).padStart(2, '0')
const month = String(date.getMonth() + 1).padStart(2, '0')
const year = date.getFullYear()
return `${day}-${month}-${year}`
}
export const formatDatetime = (dateString: string | number | Date) => {
const date = new Date(dateString)
const day = String(date.getDate()).padStart(2, '0')
const month = date.toLocaleString('id-ID', { month: 'long' }) // Aug
const year = date.getFullYear()
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
return `${day} ${month} ${year} ${hours}:${minutes}`
}