Question

I am using Tapku's calendar in my application and I want to determine if the week should start on a Sunday or a Monday depending on the user's settings. I am calling firstWeekday, but for some reason it returns 1 (Sunday) on a device where the built-in calendar starts the weeks on Mondays (and hence it should return 2):

NSCalendar* cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
[cal firstWeekday];

Any suggestions as to what I might be missing?

Was it helpful?

Solution

Ok, so it turns out this is the correct way of doing it:

[[NSCalendar currentCalendar] firstWeekday]

OTHER TIPS

How to change the default start day of the week in the iPhone and iPad calendar Launch the Settings app on your iPhone or iPad. Scroll down and tap on Mail, Contacts, Calendars. Under the Calendars section, tap on Start Week On. Here you can change the day of the week your calendar starts on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top