Skip to content

Commit df83be7

Browse files
fix: month rendering (#560)
1 parent 100f963 commit df83be7

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/components/MonthPicker/Content.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
GridProps,
66
HTMLChakraProps,
77
} from '@chakra-ui/react';
8+
import { t } from 'i18next';
89

910
import { MonthCaption } from './MonthCaption';
1011
import { useMonthPickerContext } from './MonthPickerContext';
@@ -75,7 +76,7 @@ export const Content: React.FC<React.PropsWithChildren<ContentProps>> = () => {
7576
{...(isSelected(monthAsDate) ? selectedStyle : {})}
7677
{...(isToday(monthAsDate) ? todayStyle : {})}
7778
>
78-
{month}
79+
{t(month)}
7980
</Button>
8081
);
8182
})}

src/components/MonthPicker/months.ts

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import { t } from 'i18next';
2-
31
const months = [
4-
t('components:monthPicker.months.january'),
5-
t('components:monthPicker.months.february'),
6-
t('components:monthPicker.months.march'),
7-
t('components:monthPicker.months.april'),
8-
t('components:monthPicker.months.may'),
9-
t('components:monthPicker.months.june'),
10-
t('components:monthPicker.months.july'),
11-
t('components:monthPicker.months.august'),
12-
t('components:monthPicker.months.september'),
13-
t('components:monthPicker.months.october'),
14-
t('components:monthPicker.months.november'),
15-
t('components:monthPicker.months.december'),
16-
];
2+
'components:monthPicker.months.january',
3+
'components:monthPicker.months.february',
4+
'components:monthPicker.months.march',
5+
'components:monthPicker.months.april',
6+
'components:monthPicker.months.may',
7+
'components:monthPicker.months.june',
8+
'components:monthPicker.months.july',
9+
'components:monthPicker.months.august',
10+
'components:monthPicker.months.september',
11+
'components:monthPicker.months.october',
12+
'components:monthPicker.months.november',
13+
'components:monthPicker.months.december',
14+
] as const;
1715

1816
export default months;

0 commit comments

Comments
 (0)