From dc9a0fd4150ffe97f34303c4401490c00b7d640f Mon Sep 17 00:00:00 2001 From: dfhoughton Date: Sun, 3 Feb 2019 09:39:24 -0500 Subject: added relative displacement pattern --- src/lib.rs | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 479c000..96d3fa4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,7 +207,10 @@ lazy_static! { moment_or_period => | period => | - specific_period => | | + specific_period => | | | + relative_period -> + displacement => [["week", "day", "hour", "minute", "second"]] ("s")? // not handling variable-width periods like months or years + from_now_or_ago => [["from now", "ago"]] month_and_year -> named_period => | modified_period -> @@ -249,8 +252,8 @@ lazy_static! { o_n_day => | at_time -> ("at")