Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the starting day of the week stored in NSLocale somewhere?

I live in the Netherlands. We Dutch people like to see Monday as the start of the week. I know that people in the US like to consider Sunday as the start of the week. Silly Americans ;)

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

Cheers, EP.

like image 665
epologee Avatar asked May 30 '11 21:05

epologee


1 Answers

Use the following code:

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

You may also check this relevant question.

like image 63
Anton Avatar answered Oct 05 '22 23:10

Anton