• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 'Inheriting' a NSDateFormatterStyle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >'Inheriting' a NSDateFormatterStyle (From: Matt Gough <email@hidden>)

  • Prev by Date: Setting action: with a variable
  • Next by Date: Re: Date compiled?
  • Previous by thread: 'Inheriting' a NSDateFormatterStyle
  • Next by thread: to get volume mount/unmount notification
  • Index(es):
    • Date
    • Thread