Re: Obtain an NSDate object from any casually entered user string
Re: Obtain an NSDate object from any casually entered user string
- Subject: Re: Obtain an NSDate object from any casually entered user string
- From: Charles Srstka <email@hidden>
- Date: Thu, 15 May 2014 08:12:12 -0500
On May 15, 2014, at 8:03 AM, Gerriet M. Denkmann <email@hidden> wrote:
> I always use a 24-hour clock.
Your users may not, though. In the US, at least, 24-hour clocks are definitely a minority.
> Is there a way, to make NSDataDetector aware of this fact? Some options I might set?
NSDataDetector doesn't appear to have any options at *all.*
I suppose you could do stuff like postpend "AM" to the string if the hour is less than 12, and "PM" if it's equal to 12, before running the string through NSDataDetector. The amount of string manipulation you'd have to do might defeat the purpose of using NSDataDetector, though.
Charles
_______________________________________________
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