-
Notifications
You must be signed in to change notification settings - Fork 875
Description
Bug description
When my app's locale is set to Arabic (e.g. Locale('ar', 'MA')), the SfCalendar widget displays all numbers (dates, times, week numbers) using Arabic-Indic digits (e.g. ١,٢,٣).
I want to display all numbers in Western (English) digits (0-9) only in the calendar, while keeping the rest of my app in Arabic.
Steps to reproduce
1- Set your app's locale to Arabic (e.g. Locale('ar', 'MA')).
2- Wrap SfCalendar with Localizations.override(locale: Locale('ar', 'MA')).
3- Observe that all numbers in the calendar are still Arabic-Indic digits.
Code sample
MaterialApp(
locale: Locale('ar', 'MA'),
home: Scaffold(
body: Localizations.override(
context: context,
locale: Locale('ar','MA'),
child: SfCalendar(
view: CalendarView.week,
timeSlotViewSettings: TimeSlotViewSettings(
timeFormat: 'HH:mm',
),
),
),
),
);
Activity
Mugunthan-Ramalingam commentedon Jun 10, 2025
Hi @h1amza,
You can refer to our Knowledge Base (KB) article that explains how to override the localizations in SfCalendar to display the digits instead of Arabic words for numbers in the calendar UI. We have shared the KB documentation for your reference.
KB link: https://support.syncfusion.com/kb/article/11052/how-to-override-the-material-app-locale-and-set-english-language-for-flutter-calendar
However, a GitHub sample reference is attached in the KB documentation. You can refer to the sample and customize it based on your requirements.
If you have any further queries, please get back to us. We are always happy to assist you.
Regards,
Mugunthan.
h1amza commentedon Jun 10, 2025
Thank you for your reply @Mugunthan-Ramalingam but in CalendarView.week and CalendarView.day, the hour/time labels still display Arabic-Indic digits (١٢) instead of Western digits (12).
could you guide me on how to enforce Western digits (1, 2, 3) in these views?
Appreciate your help,
h1amza commentedon Jun 11, 2025
@sfHariHaraSudhan can you please update the tag label to open
Mugunthan-Ramalingam commentedon Jun 16, 2025
Hi @h1amza,
We have created a simple sample using two SfCalendar widgets, with English set as the default localization for the app. In this sample, the first calendar is overridden with the Arabic locale using Localizations.override. As a result, the time labels and week view header date labels are rendered correctly in digits instead of Arabic numerals. The second calendar, which uses the default English locale, also renders the time and date labels in Western digits as expected.
We’ve shared this sample for your reference, and you can customize it further based on your specific requirements.
However, if you are still experiencing the issue, we kindly request you to replicate it in the shared sample and provide more specific details about the scenario. This will help us assist you more effectively.
Demo:
Sample: gh_2373.zip
Regards,
Mugunthan.
h1amza commentedon Jun 23, 2025
I found the problem in my case 🙌, the issue was caused by this line in my main : Intl.defaultLocale = locale.toLanguageTag();
This was affecting number formatting globally by setting the default locale, which caused the problem.
Thanks a lot @Mugunthan-Ramalingam for your support and guidance! 🙏