Refine transaction date input and header
This commit is contained in:
@@ -7,6 +7,15 @@ export function formatDateInput(date = new Date()) {
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`
|
||||
}
|
||||
|
||||
export function formatDateOnly(date = new Date()) {
|
||||
const pad = (n: number) => String(n).padStart(2, '0')
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`
|
||||
}
|
||||
|
||||
export function dateOnlyToNoon(value: string) {
|
||||
return `${value}T12:00`
|
||||
}
|
||||
|
||||
export function monthKey(date = new Date()) {
|
||||
const pad = (n: number) => String(n).padStart(2, '0')
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}`
|
||||
|
||||
Reference in New Issue
Block a user