Make sure timezone as an UTC fallback in case it's nil

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-03-29 10:38:50 +02:00
parent 0bc931fef0
commit 9ddcd6dff6
2 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ defmodule Mobilizon.Service.DateTime do
compare_to_day = Keyword.get(options, :compare_to_day, Date.utc_today())
compare_to = Keyword.get(options, :compare_to_datetime, DateTime.utc_now())
start_time = Keyword.get(options, :start_time, @start_time)
timezone = Keyword.get(options, :timezone, "Etc/UTC")
timezone = Keyword.get(options, :timezone, "Etc/UTC") || "Etc/UTC"
end_time = Keyword.get(options, :end_time, @end_time)
DateTime.compare(compare_to, DateTime.new!(compare_to_day, start_time, timezone)) in [