mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
Update time formats for other charts on analytics page
This commit is contained in:
parent
57503a30cf
commit
fba431bfe7
@ -4,6 +4,7 @@ import type { TooltipState } from './ChartTooltip/ChartTooltip.jsx';
|
|||||||
import { createTooltip } from './createTooltip.js';
|
import { createTooltip } from './createTooltip.js';
|
||||||
import { legendOptions } from './legendOptions.js';
|
import { legendOptions } from './legendOptions.js';
|
||||||
import type { ChartOptions } from 'chart.js';
|
import type { ChartOptions } from 'chart.js';
|
||||||
|
import { getDateFnsLocale } from 'component/insights/getDateFnsLocale.js';
|
||||||
|
|
||||||
export const createOptions = (
|
export const createOptions = (
|
||||||
theme: Theme,
|
theme: Theme,
|
||||||
@ -59,10 +60,15 @@ export const createOptions = (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
x: {
|
x: {
|
||||||
|
adapters: {
|
||||||
|
date: {
|
||||||
|
locale: getDateFnsLocale(locationSettings.locale),
|
||||||
|
},
|
||||||
|
},
|
||||||
type: 'time',
|
type: 'time',
|
||||||
time: {
|
time: {
|
||||||
unit: 'week',
|
unit: 'week',
|
||||||
tooltipFormat: 'PPP',
|
tooltipFormat: 'P',
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
color: 'transparent',
|
color: 'transparent',
|
||||||
|
@ -23,7 +23,7 @@ import type { WeekData, RawWeekData } from './types.ts';
|
|||||||
import { createTooltip } from 'component/insights/components/LineChart/createTooltip.ts';
|
import { createTooltip } from 'component/insights/components/LineChart/createTooltip.ts';
|
||||||
import { CreationArchiveRatioTooltip } from './CreationArchiveRatioTooltip.tsx';
|
import { CreationArchiveRatioTooltip } from './CreationArchiveRatioTooltip.tsx';
|
||||||
import { Chart } from 'react-chartjs-2';
|
import { Chart } from 'react-chartjs-2';
|
||||||
import { getDateFnsLocale } from './getDateFnsLocale.ts';
|
import { getDateFnsLocale } from '../../getDateFnsLocale.ts';
|
||||||
|
|
||||||
ChartJS.register(
|
ChartJS.register(
|
||||||
CategoryScale,
|
CategoryScale,
|
||||||
|
Loading…
Reference in New Issue
Block a user