there is a weird problem with UIDatePicker
when I set its calendar to NSIslamicCalendar
or NSIslamicCivilCalendar
like this:
picker.calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSIslamicCalendar];
And try to choose a first day or a last day of a random year, I notice that the current selected year is duplicated and the 2nd day of the month appears before the 1st day, as you can see in the following screenshot :
where Muharram
is the name of the first month and Dhu'l-Hijjah
is the name of the last month of the islamic calendar.
is this a bug in the UIDatePicker
or should I do some workaround to get rid of this glitch ?
p.s. this is noticed in iOS 6 & 7 simulators and there is no other properties has been set for the picker except for its calendar property.
I had the same problem, finally I realized that it is a bug in the picker and ended up with a custom picker, Apple dudes didn't bother themselves to create a perfect Islamic calendar, but they have put a little effort to customize the picker to fit the Hijri date, you can report this bug to Apple by the way.
I suggest not to count on it, you need to do a good work customizing it or you can start working on a custom picker for Hijri date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With