一周的开始日期是否存储在 NSLocale 中?
我住在荷兰。我们荷兰人喜欢将星期一视为一周的开始。我知道美国人喜欢将周日视为一周的开始。愚蠢的美国人;)
如果我想向我的全球用户呈现周视图,我可以从 NSLocale 获取一周的首选开始日期,还是设置面板是唯一的方法?
干杯, EP。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用以下代码:
您还可以查看此相关问题。
Use the following code:
You may also check this relevant question.
接受的答案实际上是不正确的。这是正确的代码:
问题是 NSLocaleCalendar 引用的对象实际上是一个日历。
The accepted answer is actually incorrect. Here's the correct code:
The issue is that the object referenced by NSLocaleCalendar is actually a calendar.