mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Added map to sessions page.
This commit is contained in:
parent
9b005e11c0
commit
af64602951
4 changed files with 17 additions and 4 deletions
|
|
@ -14,7 +14,13 @@ export function useTimezone() {
|
|||
};
|
||||
|
||||
const formatDate = (date: string, pattern: string) => {
|
||||
return formatInTimeZone(date.split(' ').join('T') + 'Z', timezone, pattern);
|
||||
return formatInTimeZone(
|
||||
/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$/.test(date)
|
||||
? date
|
||||
: date.split(' ').join('T') + 'Z',
|
||||
timezone,
|
||||
pattern,
|
||||
);
|
||||
};
|
||||
|
||||
return { timezone, saveTimezone, formatDate };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useMemo } from 'react';
|
||||
import { useState, useMemo, HTMLAttributes } from 'react';
|
||||
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
||||
import classNames from 'classnames';
|
||||
import { colord } from 'colord';
|
||||
|
|
@ -16,11 +16,12 @@ export function WorldMap({
|
|||
websiteId,
|
||||
data,
|
||||
className,
|
||||
...props
|
||||
}: {
|
||||
websiteId?: string;
|
||||
data?: any[];
|
||||
className?: string;
|
||||
}) {
|
||||
} & HTMLAttributes<HTMLDivElement>) {
|
||||
const [tooltip, setTooltipPopup] = useState();
|
||||
const { theme, colors } = useTheme();
|
||||
const { locale } = useLocale();
|
||||
|
|
@ -67,6 +68,7 @@ export function WorldMap({
|
|||
|
||||
return (
|
||||
<div
|
||||
{...props}
|
||||
className={classNames(styles.container, className)}
|
||||
data-tip=""
|
||||
data-for="world-map-tooltip"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue