From 3e2dfb3fd9f04e112f951d6e799d9be8aa829c80 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 8 Dec 2019 11:25:29 -0500 Subject: [PATCH] fix relative date ranges --- lib/search/date_parser.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/search/date_parser.ex b/lib/search/date_parser.ex index 580a7d2d..df2be451 100644 --- a/lib/search/date_parser.ex +++ b/lib/search/date_parser.ex @@ -93,8 +93,8 @@ defmodule Search.DateParser do defp relative_datetime([count, scale]) do now = DateTime.utc_now() - lower = DateTime.add(now, count * -scale, :second) - upper = DateTime.add(now, (count - 1) * -scale, :second) + lower = DateTime.add(now, (count + 1) * -scale, :second) + upper = DateTime.add(now, count * -scale, :second) [lower, upper] end