mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
Use getRequestDateRange in all routes.
This commit is contained in:
parent
b0023feee9
commit
5171bdaf47
21 changed files with 72 additions and 173 deletions
|
|
@ -310,7 +310,11 @@ export function getDayOfWeekAsDate(dayOfWeek: number) {
|
|||
return currentDate;
|
||||
}
|
||||
|
||||
export function formatDate(date: string | number | Date, dateFormat: string, locale = 'en-US') {
|
||||
export function formatDate(
|
||||
date: string | number | Date,
|
||||
dateFormat: string = 'PPpp',
|
||||
locale = 'en-US',
|
||||
) {
|
||||
return format(typeof date === 'string' ? new Date(date) : date, dateFormat, {
|
||||
locale: getDateLocale(locale),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue