Last active
January 15, 2016 05:56
-
-
Save suls/124536c26c4a1fef447f to your computer and use it in GitHub Desktop.
Is there a better way?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toDateE(s: String) = | |
\/.fromTryCatchNonFatal { | |
new org.joda.DateTime(s) | |
} | |
def toDateO(s: String) = | |
toDateE(s).toOption |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment