Updated date formatting for locales.
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user