• 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: Kevin Ballard <email@hidden>
  • Date: Tue, 1 Feb 2005 21:35:13 -0500

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: NSDateFormatter
      • From: mmalcolm crawford <email@hidden>
    • Re: NSDateFormatter
      • From: Bertrand Landry Hetu <email@hidden>
References: 
 >NSDateFormatter (From: Bertrand Landry Hetu <email@hidden>)

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