'Inheriting' a NSDateFormatterStyle
'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