Add a default timezone if user's timezone is set to null

Closes #746

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-08-20 16:48:01 +02:00
parent db6f88c0a0
commit 46bfa2c422
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -62,7 +62,7 @@ defmodule Mobilizon.Service.DateTime do
def calculate_next_day_notification(%Date{} = day, options \\ []) do def calculate_next_day_notification(%Date{} = day, options \\ []) do
compare_to = Keyword.get(options, :compare_to, DateTime.utc_now()) compare_to = Keyword.get(options, :compare_to, DateTime.utc_now())
notification_time = Keyword.get(options, :notification_time, ~T[18:00:00]) notification_time = Keyword.get(options, :notification_time, ~T[18:00:00])
timezone = Keyword.get(options, :timezone, "Etc/UTC") timezone = Keyword.get(options, :timezone, "Etc/UTC") || "Etc/UTC"
send_at = DateTime.new!(day, notification_time, timezone) send_at = DateTime.new!(day, notification_time, timezone)