Browse Source

timeAgo display for block/tx details

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
52d77a4d45
  1. 7
      views/includes/block-content.pug
  2. 7
      views/transaction.pug

7
views/includes/block-content.pug

@ -44,8 +44,11 @@ div(class="tab-content")
a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()} a(href=("/block-height/" + result.getblock.height)) #{result.getblock.height.toLocaleString()}
tr tr
th(class="table-active properties-header") Timestamp th(class="table-active properties-header") Timestamp (utc)
td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")} (utc)
- var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getblock.time) * 1000))));
td(class="monospace") #{moment.utc(new Date(result.getblock.time * 1000)).format("Y-MM-DD HH:mm:ss")}
span(class="text-muted") (#{timeAgo.format()})
tr tr
th(class="table-active properties-header") Transaction Count th(class="table-active properties-header") Transaction Count

7
views/transaction.pug

@ -59,9 +59,12 @@ block content
span(class="text-muted") (unconfirmed) span(class="text-muted") (unconfirmed)
tr tr
th(class="table-active properties-header") Timestamp th(class="table-active properties-header") Timestamp (utc)
if (result.getrawtransaction.time) if (result.getrawtransaction.time)
td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")} (utc) td(class="monospace") #{moment.utc(new Date(result.getrawtransaction["time"] * 1000)).format("Y-MM-DD HH:mm:ss")}
- var timeAgo = moment.duration(moment.utc(new Date()).diff(moment.utc(new Date(parseInt(result.getrawtransaction["time"]) * 1000))));
span(class="text-muted") (#{timeAgo.format()})
else else
td(class="monospace") N/A td(class="monospace") N/A
span(class="text-muted") (unconfirmed) span(class="text-muted") (unconfirmed)

Loading…
Cancel
Save