Re: Determining user's clock preference on iOS

2012-02-23 Thread Kyle Sluder
On Thu, Feb 23, 2012 at 2:01 PM, Rick Mann wrote: > A little more info. @"j:m" gets written to "h:mm a", which is unfortunate. It > always adds the "a". Hmm, the documentation seems to imply that iOS might do the "right thing" here, and choose the final output format based on the user's preferen

Re: Determining user's clock preference on iOS

2012-02-23 Thread Rick Mann
A little more info. @"j:m" gets written to "h:mm a", which is unfortunate. It always adds the "a". On Feb 23, 2012, at 11:37 , Dave DeLong wrote: > > On Feb 23, 2012, at 8:21 AM, Kyle Sluder wrote: > >> On Feb 22, 2012, at 10:50 PM, Rick Mann wrote: >> >>> I have a need to format times as e

Re: Determining user's clock preference on iOS

2012-02-23 Thread Rick Mann
Oh, "j" works on iOS if you pass it to -dateFormatFromTemplate:options:locale:, but only if you pass [NSLocale currentLocale] and not nil. On Mac OS X, the 12/24-hour format in the Clock is different than in the International settings. Changing the clock has no effect, but I haven't verified th

Re: Determining user's clock preference on iOS

2012-02-23 Thread Rick Mann
On Feb 23, 2012, at 11:37 , Dave DeLong wrote: > > On Feb 23, 2012, at 8:21 AM, Kyle Sluder wrote: > >> What happens if you give +[NSDateFormatter >> dateFormatFromTemplate:options:locale:] a template that contains "h:m:s a"? >> Does it rewrite it to "H:m:s" if the current locale uses 24-hour

Re: Determining user's clock preference on iOS

2012-02-23 Thread Rick Mann
On Feb 23, 2012, at 11:37 , Dave DeLong wrote: > > On Feb 23, 2012, at 8:21 AM, Kyle Sluder wrote: > >> On Feb 22, 2012, at 10:50 PM, Rick Mann wrote: >> >>> I have a need to format times as either >>> >>> 24:mm >>> >>> or >>> >>> 12:mm >>>am >>> >>> That is, if the user prefers a 2

Re: Determining user's clock preference on iOS

2012-02-23 Thread Dave DeLong
On Feb 23, 2012, at 8:21 AM, Kyle Sluder wrote: > On Feb 22, 2012, at 10:50 PM, Rick Mann wrote: > >> I have a need to format times as either >> >> 24:mm >> >> or >> >> 12:mm >> am >> >> That is, if the user prefers a 24-hour clock, I want it to appear on a >> single line. If the u

Re: Determining user's clock preference on iOS

2012-02-23 Thread David Duncan
On Feb 22, 2012, at 10:50 PM, Rick Mann wrote: > Unfortunately, there's no format specifier for the hours of the day that > indicates "use the user's preferred format." > > If I could determine the user's preference, then I'd just format it > appropriately. Alternatively, I can use the "short"

Re: Determining user's clock preference on iOS

2012-02-23 Thread Nick Zitzmann
On Feb 22, 2012, at 11:50 PM, Rick Mann wrote: > If I could determine the user's preference, then I'd just format it > appropriately. Alternatively, I can use the "short" format style, and then > parse out the AM/PM, but that seems more fragile across locales (are there > locales that use some

Re: Determining user's clock preference on iOS

2012-02-23 Thread Kyle Sluder
On Feb 22, 2012, at 10:50 PM, Rick Mann wrote: > I have a need to format times as either > >24:mm > > or > >12:mm > am > > That is, if the user prefers a 24-hour clock, I want it to appear on a single > line. If the user prefers a 12-hour clock, I want the AM/PM designator to b

Determining user's clock preference on iOS

2012-02-23 Thread Rick Mann
I have a need to format times as either 24:mm or 12:mm am That is, if the user prefers a 24-hour clock, I want it to appear on a single line. If the user prefers a 12-hour clock, I want the AM/PM designator to be rendered underneath the time (in smaller type). Unfo