lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master d785b86: Paste out to spreadsheet: show dates


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d785b86: Paste out to spreadsheet: show dates as YYYY-MM-DD, not JDN
Date: Wed, 2 May 2018 10:35:23 -0400 (EDT)

branch: master
commit d785b86f4fda40ab52e285cea4c857325ecb79d6
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Paste out to spreadsheet: show dates as YYYY-MM-DD, not JDN
---
 census_view.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/census_view.cpp b/census_view.cpp
index a63d702..597925c 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1276,7 +1276,15 @@ void CensusView::paste_out_to_spreadsheet() const
         for(auto const& header : distinct_headers)
             {
             // Assume that the trailing '\t' doesn't matter.
-            os << cell[header].str() << '\t';
+            // Show calendar dates as YYYY-MM-DD rather than JDN.
+            if(auto const& z = exact_cast<tnr_date>(cell[header]))
+                {
+                os << z->value().str() << '\t';
+                }
+            else
+                {
+                os << cell[header].str() << '\t';
+                }
             }
         os << '\n';
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]