summaryrefslogtreecommitdiff
path: root/src/times.h
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2013-03-08 21:45:56 +0100
committerJohann Klähn <kljohann@gmail.com>2013-03-08 22:56:01 +0100
commita875940a93848d4b18b5bed45049edc901ad07a2 (patch)
tree33dcb08c5cb43ada33c4c4af9b11cb7c0bf6b3ef /src/times.h
parent8f4b0e89627b082f9c5d4bd2b506661aab732b0b (diff)
downloadfork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.tar.gz
fork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.tar.bz2
fork-ledger-a875940a93848d4b18b5bed45049edc901ad07a2.zip
fix ledger xml output, remove ledger json command
As the format used by property trees to represent valid JSON and that for valid XML is too different and given that there are more requests for valid XML output I decided to pursue a quick fix and remove the json command in favor of a working xml command. See bug #782, #909, recent discussion on mailing list. JSON support is postponed until I or someone else finds time to work on this or the python bindings are more stable.
Diffstat (limited to 'src/times.h')
-rw-r--r--src/times.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/times.h b/src/times.h
index ae4e4c75..4b89cc0c 100644
--- a/src/times.h
+++ b/src/times.h
@@ -111,20 +111,12 @@ std::string format_date(const date_t& when,
void set_date_format(const char * format);
void set_input_date_format(const char * format);
-inline void put_datetime(property_tree::ptree& pt, const datetime_t& when,
- bool wrap = true) {
- if (wrap)
- pt.put("datetime", format_datetime(when, FMT_WRITTEN));
- else
- pt.put_value(format_datetime(when, FMT_WRITTEN));
+inline void put_datetime(property_tree::ptree& pt, const datetime_t& when) {
+ pt.put_value(format_datetime(when, FMT_WRITTEN));
}
-inline void put_date(property_tree::ptree& pt, const date_t& when,
- bool wrap = true) {
- if (wrap)
- pt.put("date", format_date(when, FMT_WRITTEN));
- else
- pt.put_value(format_date(when, FMT_WRITTEN));
+inline void put_date(property_tree::ptree& pt, const date_t& when) {
+ pt.put_value(format_date(when, FMT_WRITTEN));
}
struct date_traits_t