NSDate interval formatting
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