mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
fix chart and timezone issues, pass consistent dates to DB.
Closes #3700
This commit is contained in:
parent
81bedec6d5
commit
6751bf88bb
10 changed files with 157 additions and 79 deletions
|
|
@ -5,7 +5,7 @@ import { useLocale } from '@/components/hooks/useLocale';
|
|||
import { DATE_RANGE_CONFIG, DEFAULT_DATE_RANGE_VALUE } from '@/lib/constants';
|
||||
import { getItem } from '@/lib/storage';
|
||||
|
||||
export function useDateRange(options: { ignoreOffset?: boolean } = {}) {
|
||||
export function useDateRange(options: { ignoreOffset?: boolean; timezone?: string } = {}) {
|
||||
const {
|
||||
query: { date = '', offset = 0, compare = 'prev' },
|
||||
} = useNavigation();
|
||||
|
|
@ -15,6 +15,7 @@ export function useDateRange(options: { ignoreOffset?: boolean } = {}) {
|
|||
const dateRangeObject = parseDateRange(
|
||||
date || getItem(DATE_RANGE_CONFIG) || DEFAULT_DATE_RANGE_VALUE,
|
||||
locale,
|
||||
options.timezone,
|
||||
);
|
||||
|
||||
return !options.ignoreOffset && offset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue