Skip to content

Commit

Permalink
Added missing parameter combo for calc_datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
corka149 committed Apr 29, 2019
1 parent 1a3c407 commit 71bf978
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/timed.ex
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ defmodule Timed do
NaiveDateTime.from_iso8601("#{date} #{time}:00")
end

def calc_datetime([time: _], "") do
{:ok, NaiveDateTime.utc_now()}
end

def calc_datetime([time: _], time) do
date = Date.utc_today()
case Time.from_iso8601(time <> ":00") do
Expand Down

0 comments on commit 71bf978

Please sign in to comment.