iPhone - How may I work with Monday as first day of week
I'm working with many dates. For an international work, I'd like to force (and be able to let the user decide) which is the first day of week.
But, once this 开发者_StackOverflow中文版is setted (let's say Minday as first day of week), I'm searching the best way to work in my code. I see that EKSunday is 1 and EKMonday is 2.
How can I convert dynamicaly Sunday to 7 and Monday to 1 ? Am I obliged to convert each return value from different method calls (when working with components for example with the weekDay return value) ? Is there any way to foce this once for all and don't have to deal with conversion ?
Why not use the existing enumeration for coding purposes and use the first-day-of-the-week preference just to display? That way, you won't have to rebuild any existing functionality.
精彩评论