1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00
unleash.unleash/frontend/src/component/insights
Thomas Heartman 7cc3c32eb2
fix: date localizations for chart (#10581)
Adds date localization to the charts on the analytics page. In doing so,
I have extracted the default locales that we allow the user to set into
constants, so that we can reference it from other places. I have also
sorted the list and added my personal favorite format (ja) to it.

Because we have multiple charts on the analytics page, it felt weird
that only one chart should follow your preferred format. It also aligns
the existing charts' tooltip date format with the new one (`P` instead
of `PPP`).

In short: previously, the charts would show you only your system locale
(I think), which for me defaults to en-US, regardless of what setting
you'd set in your profile. Now we respect your setting as long as it's
one of the default ones.

Before (date formatting is en-US):
<img width="1444" height="1658" alt="image"
src="https://github.com/user-attachments/assets/99a893c7-efb6-4e55-b47c-9df66bf97636"
/>


After (date formatting is sv-SE):
<img width="1383" height="1653" alt="image"
src="https://github.com/user-attachments/assets/d408afd9-a8a7-46f3-8c13-9f7fde608cc4"
/>
2025-09-01 09:29:45 +00:00
..
calculate-ratio chore: show N/A for ratio if we can't calculate it (#10580) 2025-09-01 09:14:02 +02:00
components fix: date localizations for chart (#10581) 2025-09-01 09:29:45 +00:00
componentsChart fix: date localizations for chart (#10581) 2025-09-01 09:29:45 +00:00
componentsStat chore: show N/A for ratio if we can't calculate it (#10580) 2025-09-01 09:14:02 +02:00
hooks feat: basic flag creation chart (#10411) 2025-07-24 14:45:16 +03:00
sections chore: show N/A for ratio if we can't calculate it (#10580) 2025-09-01 09:14:02 +02:00
getDateFnsLocale.ts fix: date localizations for chart (#10581) 2025-09-01 09:29:45 +00:00
Insights.tsx chore(AI): lifecycleMetrics flag cleanup (#10511) 2025-08-21 14:35:11 +02:00
InsightsCharts.styles.ts feat: new flags in production explanation (#10407) 2025-07-24 11:53:25 +02:00
InsightsFilters.tsx chore(AI): lifecycleMetrics flag cleanup (#10511) 2025-08-21 14:35:11 +02:00