From 67c9cf134d1403657c766e72b96d692a7d538f65 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 11 Nov 2009 21:32:18 -0500 Subject: Added --date, similar to --account and --payee This lets you do things like store a date as the value of a tag, then run: ledger --date='has_tag("Foo") ? to_date(tag("Foo")) : date' reg --- src/chain.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/chain.cc') diff --git a/src/chain.cc b/src/chain.cc index 5839bd9e..55ef467b 100644 --- a/src/chain.cc +++ b/src/chain.cc @@ -159,6 +159,11 @@ post_handler_ptr chain_post_handlers(report_t& report, handler.reset(new sort_posts(handler, "date")); } + if (report.HANDLED(date_)) + handler.reset(new transfer_details(handler, transfer_details::SET_DATE, + report.session.journal->master, + report.HANDLER(date_).str(), + report)); if (report.HANDLED(account_)) handler.reset(new transfer_details(handler, transfer_details::SET_ACCOUNT, report.session.journal->master, -- cgit v1.2.3