From 25ea2013c63f55973914613ad87ce80d4ac6e328 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Thu, 6 Feb 2020 18:01:22 -0500 Subject: [PATCH] add missing eos token to force dase parser to backtrack --- lib/search/date_parser.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/search/date_parser.ex b/lib/search/date_parser.ex index 528e0f43..e2a5bf27 100644 --- a/lib/search/date_parser.ex +++ b/lib/search/date_parser.ex @@ -157,6 +157,7 @@ defmodule Search.DateParser do absolute_date = date_part |> optional(timezone_part) + |> eos() |> post_traverse(:absolute_datetime) |> unwrap_and_tag(:date) @@ -173,6 +174,7 @@ defmodule Search.DateParser do string("year") |> optional(string("s")) |> replace(31_536_000) ]) |> ignore(string(" ago")) + |> eos() |> reduce(:relative_datetime) |> unwrap_and_tag(:date)