mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Updated date formatting for locales.
This commit is contained in:
parent
50bc2371b8
commit
d6d0f99daa
6 changed files with 25 additions and 24 deletions
|
|
@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|||
import ChartJS from 'chart.js';
|
||||
import Legend from 'components/metrics/Legend';
|
||||
import { formatLongNumber } from 'lib/format';
|
||||
import { dateFormat, timeFormat } from 'lib/lang';
|
||||
import { dateFormat } from 'lib/date';
|
||||
import useLocale from 'hooks/useLocale';
|
||||
import useTheme from 'hooks/useTheme';
|
||||
import { DEFAUL_CHART_HEIGHT, DEFAULT_ANIMATION_DURATION, THEME_COLORS } from 'lib/constants';
|
||||
|
|
@ -46,7 +46,7 @@ export default function BarChart({
|
|||
case 'minute':
|
||||
return index % 2 === 0 ? dateFormat(d, 'H:mm', locale) : '';
|
||||
case 'hour':
|
||||
return timeFormat(d, locale);
|
||||
return dateFormat(d, 'p', locale);
|
||||
case 'day':
|
||||
if (records > 31) {
|
||||
if (w <= 500) {
|
||||
|
|
@ -93,9 +93,9 @@ export default function BarChart({
|
|||
function getTooltipFormat(unit) {
|
||||
switch (unit) {
|
||||
case 'hour':
|
||||
return 'EEE ha — MMM d yyyy';
|
||||
return 'EEE p — PPP';
|
||||
default:
|
||||
return 'EEE MMMM d yyyy';
|
||||
return 'PPPP';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue