一周的开始日存储在NSLocale的哪个地方?

epo*_*gee 5 objective-c nsdate nscalendar nsdatecomponents eventkit

我住在荷兰.我们荷兰人喜欢将周一视为本周的开始.我知道美国人喜欢将星期日视为本周的开始.傻美国人;)

如果我想向全球用户提供周视图,我可以从NSLocale获得一周中首选的开始日期,还是设置面板是唯一可行的方法?

干杯,EP.

Ant*_*ton 6

使用以下代码:

NSCalendar *calendar = [[NSLocale currentLocale] objectForKey:NSLocaleCalendar];
NSUInteger firstDay = [calendar firstWeekday];
Run Code Online (Sandbox Code Playgroud)

您还可以检查相关的问题.