• 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: NSDateFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateFormatter


  • Subject: Re: NSDateFormatter
  • From: Bertrand Landry Hetu <email@hidden>
  • Date: Tue, 1 Feb 2005 18:37:37 -0800

I thought of doing that. I was just hoping to get it for free... I must be getting spoiled by Cocoa :).

Anyway, it confirms the way I should be taking. Thanks.

Bertrand.

On Feb 1, 2005, at 6:35 PM, Kevin Ballard wrote:

Make a subclass of NSDateFormatter and override -stringForObjectValue: to check the object - if it's today, then return @"Today", otherwise, return the superclass's implementation.

You might also want to support @"Yesterday" and @"Tomorrow" as well.

On Feb 1, 2005, at 9:16 PM, Bertrand Landry Hetu wrote:

I was wondering if there was a way to use NSDateFormatter to format an NSDate into a string that would say "Today" if NSDate is today or the usual string if not (just like Mail & Finder)?

I thought setting allowNaturalLanguage to YES would do it but It seems like it really means that it supports parsing the user's input.

-- Kevin Ballard email@hidden http://www.tildesoft.com http://kevin.sb.org

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSDateFormatter (From: Bertrand Landry Hetu <email@hidden>)
 >Re: NSDateFormatter (From: Kevin Ballard <email@hidden>)

  • Prev by Date: Re: NSDateFormatter
  • Next by Date: Beginner Questions
  • Previous by thread: Re: NSDateFormatter
  • Next by thread: Re: NSDateFormatter
  • Index(es):
    • Date
    • Thread