mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import { useDateRange } from './useDateRange';
|
|
import { useTimezone } from './useTimezone';
|
|
|
|
export function useDateParameters(websiteId: string) {
|
|
const {
|
|
dateRange: { startDate, endDate, unit },
|
|
} = useDateRange(websiteId);
|
|
const { timezone, toUtc } = useTimezone();
|
|
|
|
return {
|
|
startAt: +toUtc(startDate),
|
|
endAt: +toUtc(endDate),
|
|
startDate: toUtc(startDate).toISOString(),
|
|
endDate: toUtc(endDate).toISOString(),
|
|
unit,
|
|
timezone,
|
|
};
|
|
}
|