Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Last active December 16, 2015 04:08
Show Gist options
  • Save jcromartie/5374664 to your computer and use it in GitHub Desktop.
Save jcromartie/5374664 to your computer and use it in GitHub Desktop.
self.currentItem.pubDate = [[[formats map:^id(id fmt) {
[formatter setDateFormat:fmt];
return option([formatter dateFromString:text]);
}] find:^BOOL(id maybeDate) {
return ![maybeDate isEmpty];
}] getOrElse:nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment