views:

102

answers:

0

I have an date format in a string, like this:

@"M/d/yy h:mm a"

Now I want to create text input fields for every component of that date, in the order of the given format above (which may vary depending on the locale.

Are there methods or ways to analyze this date format in such a way that the order of the date format components can be determined? The NSDateComponents class has several properties like day, month, year, etc. which can be mapped to this components of the date format string.

Before I start writing a huge parser class that tries to figure out what date component is at which order next to which other component, maybe you know a library that does exactly this?