From a2a54246b1b1e992dddfb28d3eae4554a457521d Mon Sep 17 00:00:00 2001 From: dfhoughton Date: Sat, 2 Feb 2019 14:28:22 -0500 Subject: added time around pattern --- CHANGES.md | 3 +- README.md | 5 ++ src/lib.rs | 147 ++++++++++++++++++++++++++++++++++++++++++++++++--------- tests/tests.rs | 55 +++++++++++++++++++++ 4 files changed, 186 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8e12b1b..53f10a0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,4 +13,5 @@ ## 1.0.4 * added `` pattern * added ordinals for days of the month -* added kalends, nones, ides \ No newline at end of file +* added kalends, nones, ides +* added March 5th, the fifth, etc. \ No newline at end of file diff --git a/README.md b/README.md index a5b98aa..c90a1ef 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,11 @@ Some expressions it can handle: * next weekend * 2000 * the nineteenth of March 1810 +* the 5th of November * the ides of March +* the first +* two seconds before 12:00 PM +* 1 week after May first +* 15 minutes around 12:13:43 PM The complete API is available at https://docs.rs/two_timer/0.1.0/two_timer/. diff --git a/src/lib.rs b/src/lib.rs index 980d03d..b5be34e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -212,7 +212,9 @@ lazy_static! { named_period => | modified_period -> modifiable_period => [["week", "month", "year", "pay period", "pp", "weekend"]] | | - moment -> ? ? | |