From d7b2705075b1dc896b33966cdc3f4d1d330a2d42 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Wed, 8 Jan 2025 20:22:01 -0500 Subject: [PATCH] cleanup: Remove `&standardize_datetime/1` function that's now unused In https://github.com/mbta/dotcom/pull/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: - https://github.com/mbta/dotcom/pull/2309 --- lib/dotcom_web/live/trip_planner.ex | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/dotcom_web/live/trip_planner.ex b/lib/dotcom_web/live/trip_planner.ex index 2b37263f1f..624112a696 100644 --- a/lib/dotcom_web/live/trip_planner.ex +++ b/lib/dotcom_web/live/trip_planner.ex @@ -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