i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Persian calendar

Open HansMuller opened this issue 6 years ago • 8 comments

This issue was originally reported against the Flutter project: https://github.com/flutter/flutter/issues/28926

The problem has to do withPersian week names:

This package very useful for Persians but I have a problem This package don’t support week mood

HansMuller avatar Mar 13 '19 21:03 HansMuller

Hi @HansMuller There are some problem in Intl library for Persians.

  • First day of week in Persian calendar is Saturday and is not Sunday
  • Persian calendar is Shamsi or Jalali
  • Month's name and month's length in Persian calendar is difference
  • Some times need to use different currency that isn't official

saeedgir avatar Jun 13 '21 19:06 saeedgir

up

setbap avatar Jul 28 '21 23:07 setbap

Any updates?

h1376h avatar Jul 16 '24 10:07 h1376h

Persian calendars will be supported in package:intl4x, see the options.

mosuem avatar Jul 16 '24 13:07 mosuem

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.

h1376h avatar Jul 16 '24 15:07 h1376h

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.

mosuem avatar Jul 16 '24 16:07 mosuem

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.

h1376h avatar Jul 17 '24 02:07 h1376h

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.

mosuem avatar Jul 17 '24 07:07 mosuem