From fa1927023227fa62e64025b84c8ebd1f01c5843a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 14 Apr 2020 17:50:17 +0200 Subject: [PATCH] Fix DateTime comparison !420 used Date.compare/2 instead of DateTime.compare/2 Signed-off-by: Thomas Citharel --- lib/mobilizon/events/event.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mobilizon/events/event.ex b/lib/mobilizon/events/event.ex index d3a218a63..a5454965d 100644 --- a/lib/mobilizon/events/event.ex +++ b/lib/mobilizon/events/event.ex @@ -167,7 +167,7 @@ defmodule Mobilizon.Events.Event do case fetch_field(changeset, :begins_on) do {_, begins_on} -> validate_change(changeset, :ends_on, fn :ends_on, ends_on -> - if Date.compare(begins_on, ends_on) == :gt, + if DateTime.compare(begins_on, ends_on) == :gt, do: [ends_on: "ends_on cannot be set before begins_on"], else: [] end)