From d9d04f62a3fc8196224b30a2cc47651b92e0fb31 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 Jun 2010 08:04:40 -0400 Subject: Allow period exprs "from today", "until tomorrow" --- src/times.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/times.cc') diff --git a/src/times.cc b/src/times.cc index c8eda4bf..26c91ea4 100644 --- a/src/times.cc +++ b/src/times.cc @@ -661,6 +661,16 @@ void date_parser_t::determine_when(date_parser_t::lexer_t::token_t& tok, (boost::get(*tok.value)); break; + case lexer_t::token_t::TOK_TODAY: + specifier = date_specifier_t(CURRENT_DATE()); + break; + case lexer_t::token_t::TOK_TOMORROW: + specifier = date_specifier_t(CURRENT_DATE() + gregorian::days(1)); + break; + case lexer_t::token_t::TOK_YESTERDAY: + specifier = date_specifier_t(CURRENT_DATE() - gregorian::days(1)); + break; + default: tok.unexpected(); break; -- cgit v1.2.3