Skip to content

Support Custom Calendar Systems in Date Picker #161873

@sarbagyastha

Description

@sarbagyastha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions