summaryrefslogtreecommitdiff
path: root/src/print.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-22 22:05:03 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-05-22 22:05:03 -0400
commit0f3e7e3e7fcba2b9f99dcc101b1c937ffa0fd56e (patch)
tree2d337fb0b493a7efae7613f0d04fb25b3d06eb79 /src/print.cc
parentc645ac1de7b7b492eb9096e1a16937c9d3539795 (diff)
downloadfork-ledger-0f3e7e3e7fcba2b9f99dcc101b1c937ffa0fd56e.tar.gz
fork-ledger-0f3e7e3e7fcba2b9f99dcc101b1c937ffa0fd56e.tar.bz2
fork-ledger-0f3e7e3e7fcba2b9f99dcc101b1c937ffa0fd56e.zip
The print command now honors use of --date-format
Diffstat (limited to 'src/print.cc')
-rw-r--r--src/print.cc13
1 files changed, 10 insertions, 3 deletions
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<const char *> 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 ? "* " :