Skip to content

Commit

Permalink
fix: month rendering (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannfleurydev authored Feb 22, 2025
1 parent 100f963 commit df83be7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/components/MonthPicker/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
GridProps,
HTMLChakraProps,
} from '@chakra-ui/react';
import { t } from 'i18next';

import { MonthCaption } from './MonthCaption';
import { useMonthPickerContext } from './MonthPickerContext';
Expand Down Expand Up @@ -75,7 +76,7 @@ export const Content: React.FC<React.PropsWithChildren<ContentProps>> = () => {
{...(isSelected(monthAsDate) ? selectedStyle : {})}
{...(isToday(monthAsDate) ? todayStyle : {})}
>
{month}
{t(month)}
</Button>
);
})}
Expand Down
28 changes: 13 additions & 15 deletions src/components/MonthPicker/months.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { t } from 'i18next';

const months = [
t('components:monthPicker.months.january'),
t('components:monthPicker.months.february'),
t('components:monthPicker.months.march'),
t('components:monthPicker.months.april'),
t('components:monthPicker.months.may'),
t('components:monthPicker.months.june'),
t('components:monthPicker.months.july'),
t('components:monthPicker.months.august'),
t('components:monthPicker.months.september'),
t('components:monthPicker.months.october'),
t('components:monthPicker.months.november'),
t('components:monthPicker.months.december'),
];
'components:monthPicker.months.january',
'components:monthPicker.months.february',
'components:monthPicker.months.march',
'components:monthPicker.months.april',
'components:monthPicker.months.may',
'components:monthPicker.months.june',
'components:monthPicker.months.july',
'components:monthPicker.months.august',
'components:monthPicker.months.september',
'components:monthPicker.months.october',
'components:monthPicker.months.november',
'components:monthPicker.months.december',
] as const;

export default months;

0 comments on commit df83be7

Please sign in to comment.