Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

duplicate years and days in UIDatePicker

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 :

enter image description here

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.

like image 476
JAHelia Avatar asked Nov 25 '13 05:11

JAHelia


1 Answers

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.

like image 51
Tarek Hallak Avatar answered Sep 21 '22 15:09

Tarek Hallak