aboutsummaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-08-06 00:25:02 -0700
committerAdam Soltys <[email protected]>2014-08-06 00:25:02 -0700
commita6d9c76af2b4c7f3accf27fce5ecd83fbdcaf0c1 (patch)
tree74686cb4d82380061cdf703eae0ba7dd37ab3e3d /public/js
parent5c81f355aeba4df5ea840540f302c2e55e1deddd (diff)
downloadcoinos-server-a6d9c76af2b4c7f3accf27fce5ecd83fbdcaf0c1.tar.gz
coinos-server-a6d9c76af2b4c7f3accf27fce5ecd83fbdcaf0c1.zip
Tidy up transactions list
Diffstat (limited to 'public/js')
-rw-r--r--public/js/report.coffee7
-rw-r--r--public/js/report.js6
2 files changed, 6 insertions, 7 deletions
diff --git a/public/js/report.coffee b/public/js/report.coffee
index 9f8a011b..37c5276d 100644
--- a/public/js/report.coffee
+++ b/public/js/report.coffee
@@ -63,8 +63,7 @@ display = (transactions) ->
$('.report tbody').append("""
<tr>
- <td>#{this.date}</td>
- <td>#{this.address}</td>
+ <td>#{moment(this.date, 'YYYY-MM-DD h:mm:ss').format('MMM D h:mma')}</td>
<td>#{exchange.toFixed(2)}</td>
<td>#{received.toFixed(5)}</td>
<td>#{amount.toFixed(2)}</td>
@@ -73,13 +72,13 @@ display = (transactions) ->
)
btc = 0
- $('table.report td:nth-child(4)').each(->
+ $('table.report tbody td:nth-child(3)').each(->
btc += parseFloat($(this).html())
)
$('#btc').html(btc.toFixed(5))
cad = 0
- $('table.report td:nth-child(5)').each(->
+ $('table.report tbody td:nth-child(4)').each(->
cad += parseFloat($(this).html())
)
$('#cad').html(cad.toFixed(2))
diff --git a/public/js/report.js b/public/js/report.js
index 09d16a6f..69794ad5 100644
--- a/public/js/report.js
+++ b/public/js/report.js
@@ -63,15 +63,15 @@
received = parseFloat(this.received);
amount = received * exchange;
received *= 1000;
- return $('.report tbody').append("<tr>\n <td>" + this.date + "</td>\n <td>" + this.address + "</td>\n <td>" + (exchange.toFixed(2)) + "</td>\n <td>" + (received.toFixed(5)) + "</td>\n <td>" + (amount.toFixed(2)) + "</td>\n</tr>");
+ return $('.report tbody').append("<tr>\n <td>" + (moment(this.date, 'YYYY-MM-DD h:mm:ss').format('MMM D h:mma')) + "</td>\n <td>" + (exchange.toFixed(2)) + "</td>\n <td>" + (received.toFixed(5)) + "</td>\n <td>" + (amount.toFixed(2)) + "</td>\n</tr>");
});
btc = 0;
- $('table.report td:nth-child(4)').each(function() {
+ $('table.report tbody td:nth-child(3)').each(function() {
return btc += parseFloat($(this).html());
});
$('#btc').html(btc.toFixed(5));
cad = 0;
- $('table.report td:nth-child(5)').each(function() {
+ $('table.report tbody td:nth-child(4)').each(function() {
return cad += parseFloat($(this).html());
});
return $('#cad').html(cad.toFixed(2));