From 3487c46a5a5a4b42f3a8f6ed439402764f98142f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Jan 2016 22:39:06 +0000 Subject: Fix random imbue not working bug with much less code --- project2/xml/xmlPresenter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/project2/xml/xmlPresenter.cpp b/project2/xml/xmlPresenter.cpp index 88b5108..ec3d637 100644 --- a/project2/xml/xmlPresenter.cpp +++ b/project2/xml/xmlPresenter.cpp @@ -198,10 +198,8 @@ class XmlNodeWriter : public boost::static_visitor { } if (!dateFormat.isNull()) { std::stringstream ss; - boost::date_time::time_facet * ft = new boost::date_time::time_facet(); - ss.imbue(std::locale(ss.getloc(), ft)); - ft->format(dateFormat); - ss << boost::get(i); + boost::posix_time::time_facet ft(dateFormat.as()); + ft.put(ss, ss, ' ', i); node->set_attribute("custom", ss.str()); } return true; -- cgit v1.2.3