• 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
NSDate interval formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDate interval formatting


  • Subject: NSDate interval formatting
  • From: Markus Spoettl <email@hidden>
  • Date: Tue, 20 Mar 2012 21:38:39 +0100

Hello all,

I'm looking for a way to determine how a locale would like to have date intervals formatted. NSDateFormatter has a cool method (+dateFormatFromTemplate:options:locale:) that produces a date format string that can be used to format dates where you only know which components you want to use.

Works great but doesn't help for intervals such as weekly intervals. Those can look quite different in different locales like:

en_US: March 19 - 25, 2012
de_AT: 19. - 25. März, 2012
fr_FR: 19 - 25 mars 2012

so you can't make concatenation work. Even more so as there are locales that display the same interval in reversed order. Also, +dateFormatFromTemplate:options:locale: doesn't produce proper punctuation in case you feed only a @"d" as template, which makes it even more difficult.

Does the system know about standard interval formatting? If so, is there a way to extract that information? Generally the Unicode LOCALE DATA MARKUP LANGUAGE (Unicode Technical Standard #35) guide is pretty silent on interval formatting, so is there even a definition for it?

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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: NSDate interval formatting
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: How is this an "incorrect decrement of a reference count"?
  • Next by Date: further confusion regarding the release of controls loaded from a nib
  • Previous by thread: Re: UIPickerView joy
  • Next by thread: Re: NSDate interval formatting
  • Index(es):
    • Date
    • Thread