From 888d9735e249499d79abda8793addc8397043406 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Tue, 11 Nov 2014 12:29:10 -0300 Subject: [PATCH] UI fixed --- js/controllers/history.js | 14 ++++++++++++-- views/history.html | 3 +-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/js/controllers/history.js b/js/controllers/history.js index 85c221d40..6cdee8a9f 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -36,10 +36,10 @@ angular.module('copayApp.controllers').controller('HistoryController', var data = $scope.blockchain_txs; var filename = "copay_history.csv"; - var csvContent = "data:text/csv;charset=utf-8,Date,Amount,Action,AddressTo\n"; + var csvContent = "data:text/csv;charset=utf-8,Date,Amount,Action,AddressTo,Comment\n"; data.forEach(function(it, index) { - var dataString = formatDate(it.ts) + ',' + it.amount + ',' + it.action + ',' + it.addressTo; + var dataString = formatDate(it.ts) + ',' + it.amount + ',' + it.action + ',' + it.addressTo + ',' + formatString(it.comment); csvContent += index < data.length ? dataString + "\n" : dataString; }); @@ -57,8 +57,18 @@ angular.module('copayApp.controllers').controller('HistoryController', log.error('Error formating a date'); return 'DateError' } + if (!dateObj.toJSON()) { + return ''; + } + return dateObj.toJSON().substring(0, 10); } + + + function formatString(str) { + if (!str) return ''; + return str; + } }; diff --git a/views/history.html b/views/history.html index 5ee062a86..cc1e1d957 100644 --- a/views/history.html +++ b/views/history.html @@ -11,8 +11,7 @@
-
-
+