aleksanderwozniak / table_calendar

Highly customizable, feature-packed calendar widget for Flutter
Apache License 2.0
1.82k stars 998 forks source link

Customizing Date Format When Setting Locale to 'ko_KR' #863

Closed jimmyjung closed 6 months ago

jimmyjung commented 6 months ago

Hello~

If I set locale to 'ko_KR', dates in the calendar will be displayed with a '일' appended to them. ex. 1일, 2일, 3일

cal

I want to set the header to 'ko_KR' to display the day of the week in Korean, and remove the '일' from the date.

Thank you.

synstin commented 6 months ago

I agree, I'm getting that letter and it's preventing me from upgrading the version.

aleksanderwozniak commented 6 months ago

Hey, thanks for reporting this. I'll add a proper solution with next release, but for now as a workaround you can just use version 3.1.0.

jimmyjung commented 6 months ago

Hey, thanks for reporting this. I'll add a proper solution with next release, but for now as a workaround you can just use version 3.1.0.

Thanks!

I temporarily fixed the issue with the code below

TableCalendar(
  locale: 'en_US', 
  daysOfWeekStyle: DaysOfWeekStyle(
    dowTextFormatter: (date, locale) => DateFormat.E('ko_KR').format(date)[0],
    ...
  ),
  headerStyle: HeaderStyle(
    titleTextFormatter: (date, locale) => DateFormat('yyyy년 M월', 'ko_KR').format(date),
    ...
  ),
  ...