views:

43

answers:

0

Example: An user has the US locale activated in the device and wants to enter a Jewish date. So the user uses the Jewish calendar system.

As far as I get it, I can instantiate an NSCalendar with Jewish calendar system while still using the user's locale for the date+time format and other things.

But how could I figure out the order of the NSDateComponents objects in a given calendar and locale?

Example: The date format is DD-YYYY-MM h:s. I want to devide the input into separate text fields, so I have to know which date components exist and in which order, and then create the input fields for them. I see in NSCalendar a lot of foreign units like Era and other stuff, and I really assume some calendar systems use these for input. I don't want to constrain my interface to western style date input. That's stupid, we are a big planet with millions of cultures. So best thing would be not to even think about what kind of different date inputs there are, and instead, just rely on the date components in a particular order.

If there was a way to get these NSDateComponents objects in the specified order of the date format for that locale and calendar, it would be possible to create the input fields "blind" without knowing details about the calendar (assuming the inputs are numeric). Then, when the user enters something, just validate the whole thing against the calendar. Would be damn cool if that worked.