1
0
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:
Thomas Heartman 2025-09-01 11:17:55 +02:00
parent 57503a30cf
commit fba431bfe7
No known key found for this signature in database
GPG Key ID: BD1F880DAED1EE78
3 changed files with 8 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import type { TooltipState } from './ChartTooltip/ChartTooltip.jsx';
import { createTooltip } from './createTooltip.js';
import { legendOptions } from './legendOptions.js';
import type { ChartOptions } from 'chart.js';
import { getDateFnsLocale } from 'component/insights/getDateFnsLocale.js';
export const createOptions = (
theme: Theme,
@ -59,10 +60,15 @@ export const createOptions = (
},
},
x: {
adapters: {
date: {
locale: getDateFnsLocale(locationSettings.locale),
},
},
type: 'time',
time: {
unit: 'week',
tooltipFormat: 'PPP',
tooltipFormat: 'P',
},
grid: {
color: 'transparent',

View File

@ -23,7 +23,7 @@ import type { WeekData, RawWeekData } from './types.ts';
import { createTooltip } from 'component/insights/components/LineChart/createTooltip.ts';
import { CreationArchiveRatioTooltip } from './CreationArchiveRatioTooltip.tsx';
import { Chart } from 'react-chartjs-2';
import { getDateFnsLocale } from './getDateFnsLocale.ts';
import { getDateFnsLocale } from '../../getDateFnsLocale.ts';
ChartJS.register(
CategoryScale,