Is the start day of the week stored in NSLocale?

I live in the Netherlands. We Dutch love to see Monday as the beginning of the week. I know that people in the US like to see Sunday as the beginning of the week. Stupid Americans;)

If I want to present a weekly review to my global users, can I get the preferred starting day of the week from NSLocale or is the settings panel the only way to go?

Cheers, EP.

+5
source share
2 answers

Use the following code:

NSCalendar *calendar = [[NSLocale currentLocale] objectForKey:NSLocaleCalendar];
NSUInteger firstDay = [calendar firstWeekday];

You can also check this related question.

+6
source

. :

NSCalendar *calendar = [[NSLocale currentLocale] objectForKey:NSLocaleCalendar];
self.weekStartsOnDay = [calendar firstWeekday];

, , NSLocaleCalendar, .

0

All Articles