Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How use Flutter syncfusion calendar with jalali date

I'm trying to develop calendar like this https://pub.dev/packages/syncfusion_flutter_calendar but I don't know how to use this package for Jalali date (Persian date).

like image 334
Amir Reza Masumi Avatar asked Nov 05 '20 12:11

Amir Reza Masumi


1 Answers

you can create your custom one which I think it is the best way

as you can see here

for now there is no way to use Persian(jalali) calendar with syncfusion,

here is what they have said about
.

As of now, we don’t have support for converting the calendar to jalali calendar. We have logged the feature request for the same. We will implement it in any of our upcoming releases. We appreciate your patience until then

but you can make its language to farsi(only language and not the calendar time) with loocalization

MaterialApp(
            //ignore: always_specify_types
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        // ... app-specific localization delegate[s] here
        SfGlobalLocalizations.delegate
      ],
      //ignore: always_specify_types
      supportedLocales: const [
        Locale('en'),
        Locale('fa'),
        // ... other locales the app supports
      ],
      locale: const Locale('fa'),
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
        home: MyHomePage(),
    );

again, it just changes the language

like image 66
Yahya Parvar Avatar answered Sep 29 '22 10:09

Yahya Parvar