Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds the transaction arrival time in the local timezone #167

Merged
merged 1 commit into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,14 @@ function serviceBitsToName (services) {
return serviceBits;
}

function getTransactionDatetime(utcEpochTime) {
var epoch = new Date(0);
epoch.setUTCSeconds(utcEpochTime);
var formatted_date = epoch.getFullYear() + "-" + (epoch.getMonth() + 1) + "-" + epoch.getDate() + " " + epoch.toLocaleTimeString();

return formatted_date;
}

module.exports = {
reflectPromise: reflectPromise,
redirectToConnectPageIfNeeded: redirectToConnectPageIfNeeded,
Expand Down Expand Up @@ -861,5 +869,6 @@ module.exports = {
outputTypeAbbreviation: outputTypeAbbreviation,
outputTypeName: outputTypeName,
serviceBitsToName: serviceBitsToName,
perfMeasure: perfMeasure
perfMeasure: perfMeasure,
getTransactionDatetime: getTransactionDatetime
};
1 change: 1 addition & 0 deletions views/includes/block-content.pug
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ div.tab-content
span(title=`Index in Block: #${(txIndex + offset).toLocaleString()}`, data-toggle="tooltip") ##{(txIndex + offset).toLocaleString()}
span –
a(href=("/tx/" + tx.txid)) #{tx.txid}
span – Transaction arrived at: #{utils.getTransactionDatetime(tx.time)} (local time)

if (global.specialTransactions && global.specialTransactions[tx.txid])
span
Expand Down