Skip to content

Commit

Permalink
Merge pull request #37 from inaka/alemata.120584573.fix_expiration_date
Browse files Browse the repository at this point in the history
[#120584573] fix user expiration date
  • Loading branch information
amilkr committed May 31, 2016
2 parents dad591a + 65be7d6 commit 8d1a9d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 0 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,4 @@ defmodule CredoServer.Mixfile do
{:exrm, "~> 1.0.5"}
]
end

defp description do
"""
This is a service to check public github PRs with credo syntax tool
"""
end
end
9 changes: 6 additions & 3 deletions web/models/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ defmodule CredoServer.User do
SecureRandom.uuid
end

# Get tomorrow as the new expiration date
defp new_expiration_date do
now = Ecto.DateTime.utc
%Ecto.DateTime{day: now.day + 1, hour: now.hour, min: now.min,
month: now.month, sec: now.sec, year: now.year}
:calendar.universal_time
|> :calendar.datetime_to_gregorian_seconds
|> +(60 * 60 * 24)
|> :calendar.gregorian_seconds_to_datetime
|> Ecto.DateTime.from_erl
end
end

0 comments on commit 8d1a9d5

Please sign in to comment.