From dcffd218a1e90ee9a1cdd295c0a3015edc395448 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 Jun 2010 03:18:32 -0400 Subject: 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. --- src/report.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/report.h') 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(1)); - optional begin = interval.begin(parent->session.current_year); + optional 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(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 end = interval.begin(parent->session.current_year); + // 2008/01/01 instead of 2009/01/01 (which is what end() would + // return). + optional 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(1)); - optional begin = interval.begin(parent->session.current_year); + optional begin = interval.begin(); if (! begin) throw_(std::invalid_argument, _("Could not determine beginning of period '%1'") << args.get(1)); ledger::epoch = parent->terminus = datetime_t(*begin); - parent->session.current_year = ledger::epoch->date().year(); }); OPTION__ -- cgit v1.2.3