Skip to content

Commit

Permalink
cleanup: Remove &standardize_datetime/1 function that's now unused (#…
Browse files Browse the repository at this point in the history
…2316)

In #2309, we got rid of the
`&maybe_round_datetime/1` function, which was the only caller of
`&standardize_datetime/1`. This removes that function as well.

Follow-up to:
 - #2309
  • Loading branch information
joshlarson authored Jan 9, 2025
1 parent 69d25e6 commit 6271578
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/dotcom_web/live/trip_planner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6271578

Please sign in to comment.