summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-14 08:04:40 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-14 08:04:40 -0400
commitd9d04f62a3fc8196224b30a2cc47651b92e0fb31 (patch)
tree1145b50afa1f2c073caf937eb25cf3fa0137f286 /src/times.cc
parentc4e908915cec2c3dc426417dfc07f2c09da53020 (diff)
downloadfork-ledger-d9d04f62a3fc8196224b30a2cc47651b92e0fb31.tar.gz
fork-ledger-d9d04f62a3fc8196224b30a2cc47651b92e0fb31.tar.bz2
fork-ledger-d9d04f62a3fc8196224b30a2cc47651b92e0fb31.zip
Allow period exprs "from today", "until tomorrow"
Diffstat (limited to 'src/times.cc')
-rw-r--r--src/times.cc10
1 files changed, 10 insertions, 0 deletions
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<date_time::weekdays>(*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;