Re: 'Inheriting' a NSDateFormatterStyle
Re: 'Inheriting' a NSDateFormatterStyle
- Subject: Re: 'Inheriting' a NSDateFormatterStyle
- From: "Sean McBride" <email@hidden>
- Date: Tue, 27 May 2008 12:09:17 -0400
- Organization: Rogue Research
On 5/27/08 2:32 PM, Matt Gough said:
>I want to display dates using a format string that is based on the
>ones that NSDateFormatterStyle uses, but with some bits chopped out.
>
>E.g I don't want to display the year in dates that are within the last
>year.
>
>It seems I have two choices:
>
>1. Just define my own date format string without any year portions
>
>2. Get the format string that NSDateFormatterStyle uses for a
>particular style uses and then remove unwanted sections (i.e all 'y's
>and 'Y's outside of quoted text.
>
>Option 1 is simplest, but it then prevents me from basing my format
>off the user's preferred format for a particular date style.
>
>Option 2 seems to be too fraught with pitfalls if the relevant format
>style has other quoted text that should be shown with the year.
I use option 2, it seems to work pretty well, but I agree it is
fragile. I suggest you also file a bug requesting a supported way to
display localised yearless dates. I don't think you've missed any
"correct" way to do this.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden