mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Upgraded next to 13. Fixed date filter for websites.
This commit is contained in:
parent
9b90036401
commit
0607e9f442
19 changed files with 201 additions and 296 deletions
10
lib/date.js
10
lib/date.js
|
|
@ -26,6 +26,7 @@ import {
|
|||
differenceInCalendarMonths,
|
||||
differenceInCalendarYears,
|
||||
format,
|
||||
parseISO,
|
||||
} from 'date-fns';
|
||||
import { getDateLocale } from 'lib/lang';
|
||||
|
||||
|
|
@ -38,6 +39,15 @@ export function getLocalTime(t) {
|
|||
}
|
||||
|
||||
export function parseDateRange(value, locale = 'en-US') {
|
||||
if (typeof value === 'object') {
|
||||
const { startDate, endDate } = value;
|
||||
return {
|
||||
...value,
|
||||
startDate: typeof startDate === 'string' ? parseISO(startDate) : startDate,
|
||||
endDate: typeof endDate === 'string' ? parseISO(endDate) : endDate,
|
||||
};
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const dateLocale = getDateLocale(locale);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue