Skip to content

Jalaali(Persian) Date input support #1204

Description

@inamvar

It's good to support Jalaali(Persian) date. User can input date text in Jalaali and DateFiled should parse it to Georgian date. it's very useful feature for users that using Jalaali calendar system.

Activity

  1. tig commented on Apr 13, 2021

    @tig
    Member

    I know nothing about Persian date formats.

    Is there no built-in capability in .NET for handling them? In reviewing the PR for this (#1205) I see you've added a specific flag to the API. On the surface, this appears clunky to me.

    Are you sure there's no way to add this support in a way that would ALSO add support for any other important but less common date input formats?

    What we want to avoid is having the API need to support more and more flags like this over time. If Persian is the only outlier that requires this then I'm all for the solution you've provided!

  2. inamvar commented on Apr 14, 2021

    @inamvar
    Author

    I know nothing about Persian date formats.

    Is there no built-in capability in .NET for handling them? In reviewing the PR for this (#1205) I see you've added a specific flag to the API. On the surface, this appears clunky to me.

    Are you sure there's no way to add this support in a way that would ALSO add support for any other important but less common date input formats?

    What we want to avoid is having the API need to support more and more flags like this over time. If Persian is the only outlier that requires this then I'm all for the solution you've provided!

    You can learn about Persian date here. more that 150 millions people are using this calendar. As I know there is no built-in input for that in .NET and just has a PersianCalendar class that converts Georgian date into Persian date but no input control is available.

    There are there common formats for calendar system:

    • Georgian
    • Hijri (Arabic lunar calendar)
    • Jalaali (Persian solar calendar)

    I agree that is not a good way to set a flag for each type of format. I can change it to new class and call it 'PersianDateField' but it needs to be derived from DateField class and override some of it's methods. the problem is DateField methods are not virtual and can not be overridden. do you have any idea to ignore flag parameter?

  3. tig commented on Apr 14, 2021

    @tig
    Member

    Got it.

    I imagine over time there may be more controls that take date input/display dates...

    I wonder if we should add a flag to a base class, e.g. View that gets set once to indicate Persian date formatting is in use. This could also be set automatically if it's possible to detect the user's computer-wide settings?

    Now that I mention it, are you sure there's no way to detect this is a user's preference?

  4. inamvar commented on Apr 15, 2021

    @inamvar
    Author

    Got it.

    I imagine over time there may be more controls that take date input/display dates...

    I wonder if we should add a flag to a base class, e.g. View that gets set once to indicate Persian date formatting is in use. This could also be set automatically if it's possible to detect the user's computer-wide settings?

    Now that I mention it, are you sure there's no way to detect this is a user's preference?

    I think it's possible to detect system settings, but the point is 99% of people do not change OS settings to enter a Persian date. it's because of incompatibility of other Persian programs or etc.. for example my windows calendar setting is Georgian date but in my accounting software I enter date in Jalaali format. I don't want to change my hole system setting just for an accounting software.

  5. BDisp commented on Apr 15, 2021

    @BDisp
    Collaborator

    How about to add a custom date format property in the DateField view?

  6. inamvar commented on Apr 17, 2021

    @inamvar
    Author

    How about to add a custom date format property in the DateField view?
    it's not only about date format string. the calendar system also should change. for example date format yyyy-MM-dd will be used in both Georgian and Jalaali systems.

  7. added
    designIssues regarding Terminal.Gui design (bugs, guidelines, debates, etc...)
    on Apr 20, 2021
  8. tig commented on Jan 2, 2026

    @tig
    Member

    Cleaning up stale issues. Closing. Reopen if you are super passionate about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    designIssues regarding Terminal.Gui design (bugs, guidelines, debates, etc...)

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions