Skip to content

Commit

Permalink
Add support for loading nil dates
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmessinger committed Apr 17, 2024
1 parent 557aea5 commit 02fb4d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mongo_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ defmodule Mongo.Ecto do

defp load_time(time), do: time

defp load_date(nil) do
{:ok, nil}
end

defp load_date(date) do
{:ok, date |> DateTime.to_date()}
end
Expand Down

0 comments on commit 02fb4d2

Please sign in to comment.