From 0f3e7e3e7fcba2b9f99dcc101b1c937ffa0fd56e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 22 May 2010 22:05:03 -0400 Subject: The print command now honors use of --date-format --- src/print.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/print.cc') diff --git a/src/print.cc b/src/print.cc index 34f5af51..7964b001 100644 --- a/src/print.cc +++ b/src/print.cc @@ -71,11 +71,18 @@ namespace { void print_xact(report_t& report, std::ostream& out, xact_t& xact) { + format_type_t format_type = FMT_WRITTEN; + optional format; + + if (report.HANDLED(date_format_)) { + format_type = FMT_CUSTOM; + format = report.HANDLER(date_format_).str().c_str(); + } + out << format_date(item_t::use_effective_date ? - xact.date() : xact.actual_date(), - FMT_WRITTEN); + xact.date() : xact.actual_date(), format_type, format); if (! item_t::use_effective_date && xact.effective_date()) - out << '=' << format_date(*xact.effective_date(), FMT_WRITTEN); + out << '=' << format_date(*xact.effective_date(), format_type, format); out << ' '; out << (xact.state() == item_t::CLEARED ? "* " : -- cgit v1.2.3