Open HansMuller opened 5 years ago
Hi @HansMuller There are some problem in Intl library for Persians.
up
Any updates?
Persian calendars will be supported in package:intl4x
, see the options.
Is there any roadmap or estimated date? Most of the current packages on 'pub', try to copy Material widgets and are outdated. An official support for other calendar locales would be a really nice feature to use.
We are working on shipping a stable version ASAP.
Most of the current packages on 'pub', try to copy Material widgets and are outdated.
What do you mean with copying material widgets? Could you give examples? I am not very knowledgeable about Flutter.
There are some design systems for building good looking things (widgets) on different operating systems. Android suggests using Material (flutter's implemention), apple has it's own one (flutter's implementation). And in current state of dart/flutter, because DateTime class itself does not support other formats, a developer should copy and modify the flutter's implemention (or other people's codes) for each of these different looks in a big project! Just for 10-20 line changes in each of them! And they keep updating, fixing bugs or maybe even a whole new look in the next iOS, Android, macOS, Windows design.
This could easily be done in a future that there exists a 'type' for different dateTimes.
For example, a package with more than 2000 lines uses this somewhere:
final String dateText =
DateFormat(timeSlotViewSettings.dateFormat).format(currentDate);
In current state of dart/flutter, a developer could use (shamsi_date) package
import 'package:shamsi_date/shamsi_date.dart' show Jalali;
and change that line to:
final Jalali jalali = Jalali.fromDateTime(currentDate);
final String dateText = jalali.day.toString();
And therefore copying 2000 lines and always checking that package's changes and bug fixes, just for changing 1 or 2 lines everyime.
Thanks for the explanation, that makes sense. Although people would maybe even like to use their own i18n packages, so making this injectable would also be nice for Flutter.
This issue was originally reported against the Flutter project: https://github.com/flutter/flutter/issues/28926
The problem has to do withPersian week names: