UIDatePicker for a Non-Gregorian calendar - iphone

I am using UIDatePicker in my App, which works fine for a Gregorian calendar.
But I want to use a Non-Gregorian calendar with the DatePicker, which I didn't succeed to do it!
I need it to do some conversion from Non-Gregorian to Gregorian dates, so it must work the same whatever the iPhone 'Locales' are.
Please can you answer this!
Your help is really appreciated,

Did you try setting the UIDatePicker's calendar property to a non-Gregorian calendar?

Related

Weird timezone issue with Tapku library

I have a strange issue with Tapku Calendar control library.
It was showing me wrong date information, so I replaced all timezones from
[NSTimeZone timeZoneForSecondsFromGMT:0]
to
[NSTimeZone systemTimeZone]];
All works well till here.
However, when I changed timezone in the file called
NSDate + CalendarGrid.m,
at that point my calendar selection of dates was disabled.
No touches are being detected on calendar.
I have done all this step by step and found this issue in NSDate+CalendarGrid.m file.
I have already spent lot of hours finding this.
Please help in how to fix this weird issue.
Thanks in advance.
I don't know about the touches Disabled Problem, But for fixing the wrong date information problem, what you can do is change the following line in viewDidLoad
[self.monthView selectDate:[NSDate date] month];
to
[self.monthView selectDate:[NSDate date]];
Hope it helps

Tapku Calendar - How to implement List, Day and Month view using Tapku Calendar?

i want to implement a calendar application like Month View,Day View and Week View using Tapku library for my iPhone application.MonthView already there.So i am concentrating Day and week view.If anybody having any idea for this,Please let me know?
Please let me know How to start for implementing Day and MonthView.
Thanks in Advance,
Jayaprakash S
You can refer this GitHub link to see the implementation of a calendar application like Month View,Day View and Week View using Tapku library.
https://github.com/devinross/tapkulibrary/pull/57/files
Alternatively you can try MACalendarUI project which offers calendar user interface for iPhone applications.
https://github.com/muhku/calendar-ui

Strange Timezone issue with Tapku Library Calendar

I have a weird problem with the Tapku Library Calendar.
I am showing events in Tapku Library Calendar. I am getting date from my server in America/Toronto Time zone. ie. -500.
My system and calendar time zone set to Toronto,Canada in Setting app.
So, the problem is when Calendar show one event in wrong day view (day tiles). Event is on 16th November 2011 and it is showing on 17th on to the Calendar.
11/16/2011 17:00 -0500
So I found solution to make time zone as GMT.
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:#"GMT"]];
And above working fine with Toronto time zone. Now, I set my timezone to Rome,Italy and It suppose to show that event on 16th too but it is showing on 17th.
so, the problem is if I keep above line it works fine with the Toronto, Canada Timezone and problem with the Rome,Italy Timezone and If I remove this line then it works fine for Rome,Italy and problem with Toronto,Italy.
For this I tried to set systemTimeZone and localTimeZone as well but still no luck.
So, what should I do to keep event on correct day view for all the timezones ?
Please let me know if you require any further details.
Here is an answer to a similar problem:
https://stackoverflow.com/a/9405625/220154
I think the tapku calendar sets GMT:0 as the date it uses to compare against your dates, so it mess a lot with timezones. probably you would need to reduct the date to GMT midnight when you are checking what dates to include in the calendar.
hope it helps.
All [NSTimeZone timeZoneForSecondsFromGMT:0]; should be replaced with [NSTimeZone systemTimeZone];
When it is not systemTimeZone you have to edit your dates coming out of the UIDatePicker to reflect time zone hour change, and all dates would be displayed a day later if you don't.
Here is the issue : https://github.com/devinross/tapkulibrary/issues/40

iphone uidatepicker localization

I facing a problem with localization in iphone date picker.I want the date picker to show dates only in English, but now it takes the language which is set to the region in iphone settings.I tried various things which was not useful like the below.
setting the locale setting in the nib file of the uidatepicker.
setting the locale through code
NSLocale* locale = [[NSLocale alloc] initWithLocaleIdentifier:#"en_GB"];
[datePicker setLocale:locale];
[datePicker setCalendar:[locale objectForKey:NSLocaleCalendar]];
This did not work.If any one has good ideas to resolve the issue please help
I think this is a known issue. The date picker seems to rely on the current user's country settings which you cannot change from code. In fact, I don't know what the locale property is there for. It simply does nothing.

UIDatePicker Localizatiion Problem

How to Localized UIDatePicker according to language selection from the application.
UIDatePicker has locale property so how to use please give idea.
Thank You.
I know nscalendar has different calendaridendifiers for different locales maybe there is a way to set the pickers calendar source?
So yeah I just checked the docs and there are properties you can set for a calendar a locale etc. Just use that by default it uses nil which is defaults to the users current locale as it's calendar source.