mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 04:55:36 +01:00
Merge branch 'dev' into feat/um-197-hook-up-teams
This commit is contained in:
commit
f18ee58ac8
41 changed files with 1195 additions and 875 deletions
12
lib/date.js
12
lib/date.js
|
|
@ -26,6 +26,7 @@ import {
|
|||
differenceInCalendarMonths,
|
||||
differenceInCalendarYears,
|
||||
format,
|
||||
parseISO,
|
||||
} from 'date-fns';
|
||||
import { getDateLocale } from 'lib/lang';
|
||||
|
||||
|
|
@ -37,7 +38,16 @@ export function getLocalTime(t) {
|
|||
return addMinutes(new Date(t), new Date().getTimezoneOffset());
|
||||
}
|
||||
|
||||
export function getDateRange(value, locale = 'en-US') {
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
user = await redis.get(authKey);
|
||||
}
|
||||
|
||||
log({ token, payload, user, shareToken });
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
log({ token, shareToken, payload, user });
|
||||
}
|
||||
|
||||
if (!user?.id && !shareToken) {
|
||||
log('useAuth: User not authorized');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue