diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-14 03:18:32 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-14 03:23:09 -0400 |
commit | dcffd218a1e90ee9a1cdd295c0a3015edc395448 (patch) | |
tree | 5957423c9ef3d629461f413e163917626c300c9d /src/report.h | |
parent | e2fa8c6145679231cda5ad6b6e7440f6f16e654a (diff) | |
download | ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.tar.gz ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.tar.bz2 ledger-dcffd218a1e90ee9a1cdd295c0a3015edc395448.zip |
Revised how Ledger handles the "current year"
Now when the Y directive sets the current year for a region, it affects
everything, as if the clock really were set back to that year.
Diffstat (limited to 'src/report.h')
-rw-r--r-- | src/report.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/report.h b/src/report.h index 44aed03b..6176c19b 100644 --- a/src/report.h +++ b/src/report.h @@ -393,7 +393,7 @@ public: OPTION_(report_t, begin_, DO_(args) { // -b date_interval_t interval(args.get<string>(1)); - optional<date_t> begin = interval.begin(parent->session.current_year); + optional<date_t> begin = interval.begin(); if (! begin) throw_(std::invalid_argument, _("Could not determine beginning of period '%1'") @@ -543,8 +543,9 @@ public: OPTION_(report_t, end_, DO_(args) { // -e date_interval_t interval(args.get<string>(1)); // Use begin() here so that if the user says --end=2008, we end on - // 2008/01/01 instead of 2009/01/01 (which is what end() would return). - optional<date_t> end = interval.begin(parent->session.current_year); + // 2008/01/01 instead of 2009/01/01 (which is what end() would + // return). + optional<date_t> end = interval.begin(); if (! end) throw_(std::invalid_argument, _("Could not determine end of period '%1'") @@ -665,13 +666,12 @@ public: OPTION_(report_t, now_, DO_(args) { date_interval_t interval(args.get<string>(1)); - optional<date_t> begin = interval.begin(parent->session.current_year); + optional<date_t> begin = interval.begin(); if (! begin) throw_(std::invalid_argument, _("Could not determine beginning of period '%1'") << args.get<string>(1)); ledger::epoch = parent->terminus = datetime_t(*begin); - parent->session.current_year = ledger::epoch->date().year(); }); OPTION__ |