melvitax / DateHelper

A Swift Date extension helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate if the string is correct format

jsgoupil opened this issue · comments

Using NSDate.dateFromString allows me to know if my string matches the format. If it doesn't, I get a nil.

With your extension, it should have a way to validate if my string matches a specific format. If it doesn't, give me nil. Right now, it init the date with self.init() giving me today's date...

My goal would be to try out multiple format and return a date once my format is matched. My format can be more than ISO8601 (MVC, RSS, Custom, etc)

Fixed in 4.0.0 26ce7bd