mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
add missing eos token to force dase parser to backtrack
This commit is contained in:
parent
8cb8e303a7
commit
25ea2013c6
1 changed files with 2 additions and 0 deletions
|
@ -157,6 +157,7 @@ defmodule Search.DateParser do
|
||||||
absolute_date =
|
absolute_date =
|
||||||
date_part
|
date_part
|
||||||
|> optional(timezone_part)
|
|> optional(timezone_part)
|
||||||
|
|> eos()
|
||||||
|> post_traverse(:absolute_datetime)
|
|> post_traverse(:absolute_datetime)
|
||||||
|> unwrap_and_tag(:date)
|
|> unwrap_and_tag(:date)
|
||||||
|
|
||||||
|
@ -173,6 +174,7 @@ defmodule Search.DateParser do
|
||||||
string("year") |> optional(string("s")) |> replace(31_536_000)
|
string("year") |> optional(string("s")) |> replace(31_536_000)
|
||||||
])
|
])
|
||||||
|> ignore(string(" ago"))
|
|> ignore(string(" ago"))
|
||||||
|
|> eos()
|
||||||
|> reduce(:relative_datetime)
|
|> reduce(:relative_datetime)
|
||||||
|> unwrap_and_tag(:date)
|
|> unwrap_and_tag(:date)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue