summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-02-20 04:13:02 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:25 -0400
commit27eb8b18ab00e39d8d021ff78ab016b5a1eee929 (patch)
treeec85547ae06cd759b8b24ce1ee297f5bf654417a
parent254b868fc110aceca2256b0f531d0820cdc728b5 (diff)
downloadfork-ledger-27eb8b18ab00e39d8d021ff78ab016b5a1eee929.tar.gz
fork-ledger-27eb8b18ab00e39d8d021ff78ab016b5a1eee929.tar.bz2
fork-ledger-27eb8b18ab00e39d8d021ff78ab016b5a1eee929.zip
(entries::format_last_entry): XML format now always uses the same date
format, and ignores --date-format.
-rw-r--r--xml.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/xml.cc b/xml.cc
index 6e3007b8..b02954c6 100644
--- a/xml.cc
+++ b/xml.cc
@@ -336,16 +336,14 @@ void output_xml_string(std::ostream& out, const std::string& str)
void format_xml_entries::format_last_entry()
{
- char buf[256];
- std::strftime(buf, 255, format_t::date_format.c_str(),
- std::localtime(&last_entry->_date));
+ char buf[32];
+ std::strftime(buf, 31, "%Y/%m/%d", std::localtime(&last_entry->_date));
output_stream << " <entry>\n"
<< " <en:date>" << buf << "</en:date>\n";
if (last_entry->_date_eff) {
- std::strftime(buf, 255, format_t::date_format.c_str(),
- std::localtime(&last_entry->_date_eff));
+ std::strftime(buf, 31, "%Y/%m/%d", std::localtime(&last_entry->_date_eff));
output_stream << " <en:date_eff>" << buf << "</en:date_eff>\n";
}
@@ -375,13 +373,11 @@ void format_xml_entries::format_last_entry()
output_stream << " <transaction>\n";
if ((*i)->_date) {
- std::strftime(buf, 255, format_t::date_format.c_str(),
- std::localtime(&(*i)->_date));
+ std::strftime(buf, 31, "%Y/%m/%d", std::localtime(&(*i)->_date));
output_stream << " <tr:date>" << buf << "</tr:date>\n";
}
if ((*i)->_date_eff) {
- std::strftime(buf, 255, format_t::date_format.c_str(),
- std::localtime(&(*i)->_date_eff));
+ std::strftime(buf, 31, "%Y/%m/%d", std::localtime(&(*i)->_date_eff));
output_stream << " <tr:date_eff>" << buf << "</tr:date_eff>\n";
}