diff --git a/src/api/constants.ts b/src/api/constants.ts index 381118c..9f2010d 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -351,10 +351,11 @@ export const DAYS = { saturday: 2000, sunday: 4200, } as const; - +export const START_TIME = 1721383200000; +export const END_TIME = 1721599200000; export const TIME_INTERVAL = [ - new Date(2024, 6, 19, 12), - new Date(2024, 6, 22, 0), + new Date(START_TIME), + new Date(END_TIME), ] as const; export const TIME_PADDING = 0; diff --git a/src/api/rest/events.ts b/src/api/rest/events.ts index 9f33d9f..2577c98 100644 --- a/src/api/rest/events.ts +++ b/src/api/rest/events.ts @@ -5,6 +5,8 @@ import { TIME_PADDING, TIME_WIDTH, TIME_INTERVAL, + START_TIME, + END_TIME, } from '../constants'; import { Context } from '@/types/graphql'; import { scaleTime } from 'd3-scale'; @@ -13,7 +15,7 @@ import { Item } from '@/types/item'; import { getTreeById } from '@/api/rest/tree'; import { defaultFetchCacheOptions } from '@/api/rest/caching'; const toPixel = (stamp: number, s: (d: Date) => number) => - s(new Date(Math.max(1721376000000, Math.min(stamp * 1000, 1721598631000)))); + s(new Date(Math.max(START_TIME, Math.min(stamp * 1000, END_TIME)))); export const toDate = (stamp: number) => new Date(stamp * 1000); const toEnd = (end?: string) => parseInt(end ?? '0');