-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Shamsi (Jalali) calendar type #16
Comments
Thanks for reporting, seems like something we want to support. What I would like to make sure is that we support it for both platforms. We could wrap the android component you linked. Using |
So, I should search and make sure to find a suitable component for Android. Then i can start to write a wrapper. For iOS, can anyone confirm it, this: dateFormatter.calendar = NSCalendar(identifier: NSCalendarIdentifierPersian)
dateFormatter.locale = NSLocale(localeIdentifier: "fa_IR") is would do what we want? |
@Swaagie |
Also, I've found a react implementation for date picker it very customizable, It might be worth taking the time and implement a customizable date time picker for android from scratch by inspiring from that library. each existing libraries have annoying limitations and lack of maintenance. developing a general date picker in this react-native community could make sure that it will always up to date. |
I found another library that supports both gregorian and Jalali(shamsi) calendar at the same time. other solution is to replace the whole current android module with this library |
@SaeedZhiany this is great! |
I figure out the library is an extension of this library and has added Jalali calendar support to it. So I create an issue in @wdullaer's library and suggest to add DateTimePicker support. if the DateTimePicker can be added there, then we can add to @mohseneo's library and then finally we can add DateTimePicker android support in react-native (just like IOS). It would be great if all you guys contribute. |
I have submitted a PR to @wdullaer's library and added Jalali calendar and font support to it. So we no longer need to @mohseneo' library (I merge his code with wdullaer's latest code on the master branch and fixed some bugs like force close when screen rotations that exist in Mohseneo's library as well) and we can use Wdullaer's library directly after the PR has been merged. additionally, I added locale support for Jalali calendar (Persian and English locales that are mostly used locales in Iran) |
@SaeedZhiany tnx 😍👌🏻 |
@SaeedZhiany |
I prefer to not do that, because we may miss future PRs on @wdullaer's original repository. also I have not seen any active maintenance on this repository too. there are six PRs on this repository with no review, so I'm not sure this is good idea to add another one here and still have to waiting to review. (I'm not going to blame anyone, this is open-source world and no one has an obligation to work for free when they can earn money) I prefer to wait to merge my PR on the other repository, because it may @wdullaer wants to have some changes on his repository that effects on the PR we want to submit here. Meanwhile I recommend you to use react-native-modern-datepicker. it has not a native view on platforms but at least it supports Jalali calendar too. |
Feature Request
Why it is needed
There are some other calendar types such as Shamsi (mostly used in Iran and Afghanistan). Currently, there is no complete and fully customizable component for Shamsi type which looks native.
Possible implementation
We can add it to the components (maybe via a
calendarType
prop. I also found this component for android which i can create a wrapper for it if it's needed. For iOS, AFAIK, we can customize the locale bylocale
prop which is already implemented (here) - [Source]Code sample
Any ideas?
The text was updated successfully, but these errors were encountered: