boredzo / iso-8601-date-formatter

A Cocoa NSFormatter subclass to convert dates to and from ISO-8601-formatted strings. Supports calendar, week, and ordinal formats.
http://boredzo.org/iso8601dateformatter/
Other
600 stars 140 forks source link

firstWeekday set to 2 #32

Closed hermanccw closed 11 years ago

hermanccw commented 11 years ago

Just curious why firstWeekday is set to 2 instead of depending on NSLocale or [NSCalendar currentCalendar].

boredzo commented 11 years ago

The ISO 8601 calendar is the Gregorian calendar with weeks starting on Monday. That's true no matter where the user is. The user's locale or calendar would be wrong for this purpose.

I don't know off-hand whether setting firstWeekday affects anything we care about, but until test coverage in the formatter class is much closer to 100%, I'm inclined to leave it.