Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jimmyjung opened this issue Mar 29, 2024 · 3 comments · Fixed by #881
Closed

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

jimmyjung opened this issue Mar 29, 2024 · 3 comments · Fixed by #881
Labels
bug Something isn't working

Comments

@jimmyjung
Copy link

jimmyjung commented Mar 29, 2024

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.

@jimmyjung jimmyjung added the bug Something isn't working label Mar 29, 2024
@synstin
Copy link

synstin commented Mar 30, 2024

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

@aleksanderwozniak
Copy link
Owner

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
Copy link
Author

jimmyjung commented Apr 2, 2024

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

  • To set locale : 'en_US'
  • To set dowTextFormatter and titleTextFormatter to ko_KR
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),
    ...
  ),
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants