Remove '일' suffix from Korean calendar day numbers

Modified formatDay function in both calendar components:
- For Korean locale (ko), display only the day number (e.g., '10' instead of '10일')
- For other locales, use default toLocaleString formatting

Changes:
- nice-calendar.tsx: Updated formatDay to check currentLocale === 'ko'
- nice-calendar-month.tsx: Updated formatDay to check currentLocale === 'ko'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jay Sheen
2025-10-31 16:59:36 +09:00
parent 70a40c1c01
commit 2ff49ef4ab
2 changed files with 8 additions and 0 deletions

View File

@@ -77,6 +77,10 @@ const NiceCalendarMonth = ({
}); });
}; };
const formatDay = (locale: string | undefined, date: Date) => { const formatDay = (locale: string | undefined, date: Date) => {
// For Korean locale, return only the day number without '일'
if (currentLocale === 'ko') {
return date.getDate().toString();
}
return date.toLocaleString(currentLocale, { return date.toLocaleString(currentLocale, {
day: 'numeric' day: 'numeric'
}); });

View File

@@ -83,6 +83,10 @@ const NiceCalendar = ({
}); });
}; };
const formatDay = (locale: string | undefined, date: Date) => { const formatDay = (locale: string | undefined, date: Date) => {
// For Korean locale, return only the day number without '일'
if (currentLocale === 'ko') {
return date.getDate().toString();
}
return date.toLocaleString(currentLocale, { return date.toLocaleString(currentLocale, {
day: 'numeric' day: 'numeric'
}); });