Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: Remove &standardize_datetime/1 function that's now unused #2316

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lib/dotcom_web/live/trip_planner.ex
Original file line number Diff line number Diff line change
@@ -372,17 +372,6 @@ defmodule DotcomWeb.Live.TripPlanner do
defp add_datetime_if_needed(%{"datetime" => datetime} = params) when datetime != nil, do: params
defp add_datetime_if_needed(params), do: params |> Map.put("datetime", nearest_5_minutes())

# Convert a NaiveDateTime to a DateTime in the America/New_York timezone.
defp standardize_datetime(%NaiveDateTime{} = datetime) do
Timex.to_datetime(datetime, "America/New_York")
end

# The lack of a datetime means we should use the nearest 5 minutes.
defp standardize_datetime(nil), do: Timex.now("America/New_York")

# If the datetime is already a DateTime, we don't need to do anything.
defp standardize_datetime(datetime), do: datetime

# Set an action on the changeset and submit it.
#
# - Update the input form state with the new changeset