Apply dynamic locale to list-date-group components for i18n support
- Update moment locale based on current language (ko/en-gb) - Apply to transaction, settlement, and additional-service modules - Add service name localization in transaction list-date-group - Date format displays weekday in user's language (ko: 수, en: Wed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import moment from 'moment';
|
||||
import 'moment/dist/locale/ko';
|
||||
import 'moment/dist/locale/en-gb';
|
||||
import { ListDateGroupProps } from '../model/types';
|
||||
import { ListItem } from '../ui/list-item';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const ListDateGroup = ({
|
||||
additionalServiceCategory,
|
||||
@@ -10,7 +12,12 @@ export const ListDateGroup = ({
|
||||
items,
|
||||
onResendClick
|
||||
}: ListDateGroupProps) => {
|
||||
moment.locale('ko');
|
||||
const { i18n } = useTranslation();
|
||||
|
||||
// Set moment locale based on current language
|
||||
const currentLocale = i18n.language === 'ko' ? 'ko' : 'en-gb';
|
||||
moment.locale(currentLocale);
|
||||
|
||||
const getStateDate = () => {
|
||||
let stateDate = moment(date).format('YY.MM.DD(ddd)');
|
||||
return stateDate;
|
||||
|
||||
Reference in New Issue
Block a user