Make sure we have a valid timezone
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
b28402f7a7
commit
bab751591f
|
@ -291,6 +291,8 @@ defmodule Mobilizon.Service.Notifications.Scheduler do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp date_to_datetime(%Date{} = day, time, timezone) do
|
defp date_to_datetime(%Date{} = day, time, timezone) do
|
||||||
|
# Just in case
|
||||||
|
timezone = timezone || "Etc/UTC"
|
||||||
{:ok, datetime} = NaiveDateTime.new(day, time)
|
{:ok, datetime} = NaiveDateTime.new(day, time)
|
||||||
{:ok, datetime} = DateTime.from_naive(datetime, timezone)
|
{:ok, datetime} = DateTime.from_naive(datetime, timezone)
|
||||||
datetime
|
datetime
|
||||||
|
|
Loading…
Reference in a new issue