mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-11 02:37:22 +03:00
Fixed issue due to immutability
This commit is contained in:
parent
0275908f69
commit
bc5c25deb0
1 changed files with 6 additions and 6 deletions
|
@ -49,11 +49,11 @@ const STEPS_MAP: Record<Step, string> = {
|
|||
hourly: 'Hour',
|
||||
};
|
||||
|
||||
const STEP_TO_DURATION_MAP: Record<Step, Duration> = {
|
||||
hourly: { hours: 1 },
|
||||
daily: { days: 1 },
|
||||
weekly: { weeks: 1 },
|
||||
monthly: { months: 1 },
|
||||
const STEP_TO_DURATION_MAP: Record<Step, (amount: number) => Duration> = {
|
||||
hourly: (hours: number) => ({ hours }),
|
||||
daily: (days: number) => ({ days }),
|
||||
weekly: (weeks: number) => ({ weeks }),
|
||||
monthly: (months: number) => ({ months }),
|
||||
};
|
||||
|
||||
const STEP_TO_DIFF_FUNC_MAP: Record<Step, (dateLeft: Date, dateRight: Date) => number> = {
|
||||
|
@ -115,7 +115,7 @@ const generateLabels = (step: Step, visits: NormalizedVisit[]): string[] => {
|
|||
|
||||
return [
|
||||
formatter(oldestDate),
|
||||
...rangeOf(size, () => formatter(add(oldestDate, duration))),
|
||||
...rangeOf(size, (num) => formatter(add(oldestDate, duration(num)))),
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue