Terminal.Gui
Terminal.Gui copied to clipboard
Jalaali(Persian) Date input support
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.
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!
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?
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?
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.
How about to add a custom date format property in the DateField
view?
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 formatyyyy-MM-dd
will be used in bothGeorgian
andJalaali
systems.