Created
April 19, 2017 17:46
-
-
Save yasserhussain1110/b8e53033f035dddacd6fe43a2fec7632 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 parse_natural(input) do | |
with {:error, _} <- Timex.parse(input, "{Mfull} {D}, {YYYY}"), | |
{:error, _} <- Timex.parse(input, "{Mfull} {D} {YYYY}") do | |
{:error, "Failed to parse date"} | |
else | |
{:ok, date_time} -> {:ok, date_time} | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment