-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
Currently, date picker supports only the Gregorian calendar system. This limitation makes it difficult to build apps that cater to regions and communities using [alternative calendar systems, such as:
- Nepali
- Islamic (Hijri)
- Hebrew
- Chinese
- Japanese
- Thai Solar
- Persian (Shamsi)
- And many more (see List of Calendars).
For example, an app serving an audience in Nepal would require the Nepali (Bikram Sambat) calendar for date selection, while a globalized app might want to allow users to select their preferred calendar system.
Proposal
Introduce support for custom calendar systems in the date picker by allowing developers to inject their own calendar logic.
Currently the calendar logic is mostly dependent on the DateUtils class's static method. Instead a delegate class can be made to swap the calendar logic, something like this: https://github.com/sarbagyastha/nepali_date_picker/blob/m3/lib/src/nepali_date_picker_delegate.dart