summaryrefslogtreecommitdiff
path: root/src/times.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-09-14 19:41:20 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-09-14 19:44:30 -0400
commit53c6e826f1e41f29c86f1c86f179f38838123d1d (patch)
tree99e9113d9089cda0b9978781681e4f2ba399ab7b /src/times.h
parent6d020a9b0ba2f20054de529f0183d23afdf32972 (diff)
downloadfork-ledger-53c6e826f1e41f29c86f1c86f179f38838123d1d.tar.gz
fork-ledger-53c6e826f1e41f29c86f1c86f179f38838123d1d.tar.bz2
fork-ledger-53c6e826f1e41f29c86f1c86f179f38838123d1d.zip
Restored --format, --date-format (-y), and --input-date-format options.
Diffstat (limited to 'src/times.h')
-rw-r--r--src/times.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/times.h b/src/times.h
index 6abd2109..a7f905e6 100644
--- a/src/times.h
+++ b/src/times.h
@@ -89,10 +89,11 @@ inline string format_datetime(const datetime_t& when)
inline string format_date(const date_t& when,
const optional<string>& format = none)
{
- if (format) {
+ if (format || ! output_date_format.empty()) {
char buf[256];
std::tm moment = gregorian::to_tm(when);
- std::strftime(buf, 255, format->c_str(), &moment);
+ std::strftime(buf, 255, format ?
+ format->c_str() : output_date_format.c_str(), &moment);
return buf;
} else {
return to_simple_string(when).substr(2);