feat: daily report

This commit is contained in:
efrilm
2025-08-11 02:12:19 +07:00
parent b648349ebd
commit 3440aaa764
11 changed files with 676 additions and 10 deletions
+15 -1
View File
@@ -23,9 +23,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}`
}