summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-01-21 04:33:56 -0500
committerJohn Wiegley <johnw@newartisans.com>2010-01-21 04:33:56 -0500
commit590ba76bd1440ca2acda562857bae4733619e1f5 (patch)
treefa58848be2bd24794c748c620f26f60546507d04
parent0a3d66c5d6b51a50afdc28b67fac54359e0dbf3e (diff)
downloadfork-ledger-590ba76bd1440ca2acda562857bae4733619e1f5.tar.gz
fork-ledger-590ba76bd1440ca2acda562857bae4733619e1f5.tar.bz2
fork-ledger-590ba76bd1440ca2acda562857bae4733619e1f5.zip
Restore "-p this" option (aka -p 'this month')
-rw-r--r--src/times.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/times.cc b/src/times.cc
index 7ea3ae32..963639f1 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -824,15 +824,6 @@ date_interval_t date_parser_t::parse()
break;
}
- case lexer_t::token_t::TOK_MONTH: {
- date_t temp(today);
- temp += gregorian::months(adjust);
- inclusion_specifier =
- date_specifier_t(static_cast<date_specifier_t::year_type>(temp.year()),
- temp.month());
- break;
- }
-
case lexer_t::token_t::TOK_WEEK: {
date_t temp =
date_duration_t::find_nearest(today, date_duration_t::WEEKS);
@@ -852,10 +843,15 @@ date_interval_t date_parser_t::parse()
}
default:
- tok.unexpected();
+ case lexer_t::token_t::TOK_MONTH: {
+ date_t temp(today);
+ temp += gregorian::months(adjust);
+ inclusion_specifier =
+ date_specifier_t(static_cast<date_specifier_t::year_type>(temp.year()),
+ temp.month());
break;
}
- break;
+ }
}
case lexer_t::token_t::TOK_TODAY: