added created time and block time to transction details page

This commit is contained in:
Akinwale Ariwodola 2017-08-26 14:27:57 +01:00
parent df2bb0c960
commit 836b7e15b3
2 changed files with 31 additions and 0 deletions

View file

@ -17,6 +17,33 @@
<h4><?php echo $tx->Hash ?></h4>
</div>
<div class="tx-time">
<div class="created-time">
<h3 title="Represents the time this transaction was created on the explorer">Time Created</h3>
<div><?php echo $tx->Created->format('j M Y H:i:s') . ' UTC '; ?></div>
</div>
<div class="conf-time">
<h3 title="The time the first confirmation of this transaction happened on the blockchain">Block Time</h3>
<div><?php echo ($tx->TransactionTime == null || strlen(trim($tx->TransactionTime)) == 0) ? '<em>Not yet confirmed</em>' :
\DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?>
<?php if ($tx->TransactionTime > $tx->Created->getTimestamp()):
$diffSeconds = $tx->TransactionTime - $tx->Created->Timestamp();
if ($diffSeconds <= 60) {
echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's');
} else {
$diffMinutes = ceil($diffSeconds / 60);
echo sprintf(' (+%s minute%s)', $diffMinutes, $diffMinutes == 1 ? '' : 's');
}
?>
<?php endif; ?>
</div>
</div>
<div class="clear"></div>
</div>
<div class="tx-summary">
<div class="box p25">
<div class="title">Amount (LBC)</div>

View file

@ -195,6 +195,10 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
.tx-head h3 { font-size: 200%; margin-bottom: 3px }
.tx-head h4 { font-size: 125% }
.tx-time { width: 1200px; margin: 0 auto 32px auto; font-weight: 300 }
.tx-time h3 { font-size: 105%; margin: 0; margin-bottom: 4px; font-weight: normal; cursor: help; border-bottom: 1px dotted #999; display: inline-block }
.tx-time .created-time, .tx-time .conf-time { float: left; width: 25% }
.realtime-head { width: 1200px; margin: 0 auto 36px auto; cursor: default }
.realtime-head h3 { font-weight: 300; margin: 0; font-size: 200% }
.realtime-main { width: 1200px; margin: 0 auto 0 auto }