• 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
'Inheriting' a NSDateFormatterStyle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'Inheriting' a NSDateFormatterStyle


  • Subject: 'Inheriting' a NSDateFormatterStyle
  • From: Matt Gough <email@hidden>
  • Date: Tue, 27 May 2008 14:32:53 +0200

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.

Is there a simple way to accomplish option 2 that I have overlooked, or should I just go with option 1 (which will be adequate for the majority of our users)

Matt Gough
_______________________________________________

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


  • Follow-Ups:
    • Re: 'Inheriting' a NSDateFormatterStyle
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Re: Returning all usernames
  • Next by Date: Re: File's Owner
  • Previous by thread: Re: two more hurdles for my calculator...
  • Next by thread: Re: 'Inheriting' a NSDateFormatterStyle
  • Index(es):
    • Date
    • Thread