Fix + format date/time values across entire site

-Added a new client-side library for date/time formatting: Luxon v1.26.0
-Added new date/time settings for display format, timezone (utc or local) and an option to enable alternate timezone tooltips
-All date/time values are now formatted via Luxon and displayed according to the new configurable settings
-All markets now return Trade History timestamp values as unix timestamp values formatted in seconds
This commit is contained in:
joeuhren
2021-03-28 21:02:10 -06:00
parent 9cdcfe659f
commit 40b6a641f5
22 changed files with 199 additions and 84 deletions
+1
View File
@@ -72,6 +72,7 @@ Table of Contents
- Bootstrap v4.5.3
- DataTables v1.10.22
- FontAwesome v5.15.1
- Luxon v1.26.0
- jqPlot v1.0.9.d96a669
- Chart.js v2.9.4
- flag-icon-css v3.5.0 ([https://github.com/lipis/flag-icon-css](https://github.com/lipis/flag-icon-css))
+1 -1
View File
@@ -65,7 +65,7 @@ function get_trades(coin, exchange, cb) {
price: body[i]['price'],
quantity: body[i]['amount'],
total: body[i]['total'],
timestamp: new Date(body[i]['created_at'] * 1000).toUTCString()
timestamp: body[i]['created_at']
};
trades.push(trade);
+1 -1
View File
@@ -53,7 +53,7 @@ function get_trades(coin, exchange, cb) {
ordertype: body[i]['takerSide'],
price: body[i]['rate'],
quantity: body[i]['quantity'],
timestamp: body[i]['executedAt']
timestamp: parseInt(new Date(body[i]['executedAt']).getTime()/1000)
};
trades.push(trade);
+1 -1
View File
@@ -41,7 +41,7 @@ function get_trades(coin, exchange, cb) {
price: body.result[i]['Price'],
quantity: body.result[i]['Quantity'],
total: body.result[i]['Total'],
timestamp: body.result[i]['TimeStamp']
timestamp: parseInt(new Date(body.result[i]['TimeStamp']).getTime()/1000)
};
trades.push(trade);
+1 -1
View File
@@ -39,7 +39,7 @@ function get_trades(coin, exchange, cb) {
ordertype: body[i].side,
quantity: body[i].volume,
price: body[i].price,
timestamp: body[i].timestamp
timestamp: parseInt(new Date(body[i].timestamp).getTime()/1000)
};
trades.push(trade);
+1 -1
View File
@@ -40,7 +40,7 @@ function get_trades(coin, exchange, cb) {
price: body[i]['rate'],
quantity: body[i]['amount'],
total: body[i]['total'],
timestamp: body[i]['date']
timestamp: parseInt(new Date(body[i]['date'] + 'Z').getTime()/1000)
};
trades.push(trade);
+1 -1
View File
@@ -37,7 +37,7 @@ function get_trades(coin, exchange, stex_id, cb) {
ordertype: body.data[i].type,
price: body.data[i].price,
quantity: body.data[i].amount,
timestamp: new Date(body.data[i].timestamp * 1000).toUTCString()
timestamp: body.data[i].timestamp
};
trades.push(trade);
+1 -1
View File
@@ -43,7 +43,7 @@ function get_trades(coin, exchange, cb) {
ordertype: (body[coin + '_' + exchange][i]['type'].toLowerCase() == 'bid' ? 'BUY' : 'SELL'),
price: body[coin + '_' + exchange][i].price,
quantity: body[coin + '_' + exchange][i].amount,
timestamp: new Date(body[coin + '_' + exchange][i].timestamp * 1000).toUTCString()
timestamp: body[coin + '_' + exchange][i].timestamp
};
trades.push(trade);
+15
View File
@@ -97,6 +97,21 @@ exports.shared_pages = {
// NOTE: The path root is /public
// The optimum logo size is 128x128 as the image will be forced to 128px high when displayed
"logo": "/img/logo.png",
// date_time: a collection of settings that pertain to the date and time values displayed in the explorer
"date_time": {
// display_format: The format to use when displaying date/time values
// Date/time values are formatted using the Luxon library and must follow the correct syntax (read more: https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)
// Ex: LLL dd, yyyy HH:mm:ss ZZZZ = May 27, 2019 22:04:11 UTC
"display_format": "LLL dd, yyyy HH:mm:ss ZZZZ",
// timezone: All dates and times are stored as UTC dates and can either be displayed in UTC format or else they can be displayed in the local timezone according to a user's web browser settings
// valid options: utc or local
"timezone": "utc",
// enable_alt_timezone_tooltips: Determine if dates and times should have a mouse-over tooltip which displays an alternate timezone value
// If set to true and the "shared_pages.date_time.timezone" setting is set to "utc" then enabling this option will display date/time tooltips in the local browser's timezone
// If set to true and the "shared_pages.date_time.timezone" setting is set to "local" then enabling this option will display date/time tooltips in the UTC timezone
// If set to false, no tooltips will be displayed for any date/time values
"enable_alt_timezone_tooltips": false
},
// table_header_bgcolor: Change the background color of all table headers
// valid options: light, dark or leave blank ( "" ) for default colors
"table_header_bgcolor": "",
+1
View File
File diff suppressed because one or more lines are too long
+15
View File
@@ -96,6 +96,21 @@
// NOTE: The path root is /public
// The optimum logo size is 128x128 as the image will be forced to 128px high when displayed
"logo": "/img/logo.png",
// date_time: a collection of settings that pertain to the date and time values displayed in the explorer
"date_time": {
// display_format: The format to use when displaying date/time values
// Date/time values are formatted using the Luxon library and must follow the correct syntax (read more: https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)
// Ex: LLL dd, yyyy HH:mm:ss ZZZZ = May 27, 2019 22:04:11 UTC
"display_format": "LLL dd, yyyy HH:mm:ss ZZZZ",
// timezone: All dates and times are stored as UTC dates and can either be displayed in UTC format or else they can be displayed in the local timezone according to a user's web browser settings
// valid options: utc or local
"timezone": "utc",
// enable_alt_timezone_tooltips: Determine if dates and times should have a mouse-over tooltip which displays an alternate timezone value
// If set to true and the "shared_pages.date_time.timezone" setting is set to "utc" then enabling this option will display date/time tooltips in the local browser's timezone
// If set to true and the "shared_pages.date_time.timezone" setting is set to "local" then enabling this option will display date/time tooltips in the UTC timezone
// If set to false, no tooltips will be displayed for any date/time values
"enable_alt_timezone_tooltips": false
},
// table_header_bgcolor: Change the background color of all table headers
// valid options: light, dark or leave blank ( "" ) for default colors
"table_header_bgcolor": "",
+2 -2
View File
@@ -63,7 +63,7 @@ block content
}
},
rowCallback: function (row, data, index) {
var timestamp = new Date(data[0] * 1000).toUTCString(); //variables for better readability
var timestamp = data[0]; //variables for better readability
var txhash = data[1]; //variables for better readability
var out = data[2]; //variables for better readability
var vin = data[3]; //variables for better readability
@@ -98,7 +98,7 @@ block content
var amountParts = amount.split('.');
$("td:eq(2)", row).html(updown + amountParts[0] + '.<span class="decimal">' + amountParts[1] + '</span>').addClass(rowclass + ' text-center');
$("td:eq(3)", row).html(balanceParts[0] + '.<span class="decimal">' + balanceParts[1] + '</span>').addClass('text-center');
$("td:eq(4)", row).html(format_unixtime(new Date(timestamp), true)).addClass('text-center');
$("td:eq(4)", row).html('<span' + (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true ? ' data-toggle="tooltip" data-placement="auto" title="' + format_unixtime(timestamp, true) + '"' : '') + '>' + format_unixtime(timestamp) + '</span>').addClass('text-center');
},
fnDrawCallback: function(settings) {
fixDataTableColumns();
+14 -5
View File
@@ -2,7 +2,6 @@ extends layout
block content
include ./includes/common.pug
- var time = format_unixtime(block.time);
- var block_difficulty = parseFloat(block.difficulty).toFixed(4);
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
@@ -19,7 +18,14 @@ block content
fnDrawCallback: function(settings) {
fixDataTableColumns();
}
})
});
$('span#timestampCol').html(format_unixtime(#{block.time}));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#timestampCol').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(#{block.time}, true));
enableTooltips();
}
});
.col-xs-12.col-md-12
.card.card-default.border-0.cardSpacer
@@ -68,7 +74,8 @@ block content
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
td.text-center
span#timestampCol
else
if block.confirmations < (confirmations / 2)
tr.bg-danger
@@ -82,7 +89,8 @@ block content
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
td.text-center
span#timestampCol
else
tr.table-warning
td.text-center=block.height
@@ -95,7 +103,8 @@ block content
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
td.text-center
span#timestampCol
if block.hash == settings.block_page.genesis_block
.alert.alert-info(role='alert', style='text-align:center;')
strong #{settings.locale.block_genesis}
+10 -50
View File
@@ -1,51 +1,11 @@
script(type='text/javascript', src='/js/luxon.min.js')
script.
function format_unixtime(unixtime, skipIncrease) {
skipIncrease = skipIncrease || false;
var a = new Date(unixtime*(skipIncrease ? 1 : 1000));
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var date = a.getDate();
var hour = a.getHours();
var min = a.getMinutes();
var sec = a.getSeconds();
var suffix = 'th';
if (date == 1 || date == 21 || date == 31)
suffix = 'st';
if (date == 2 || date == 22 || date == 32)
suffix = 'nd';
if (date == 3 || date == 23)
suffix = 'rd';
if (hour < 10)
hour = '0' + hour;
if (min < 10)
min = '0' + min;
if (sec < 10)
sec = '0' + sec;
return date + suffix + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec + ' GMT';
};
- function format_unixtime(unixtime, skipIncrease) {
- skipIncrease = skipIncrease || false;
- var a = new Date(unixtime*(skipIncrease ? 1 : 1000));
- var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
- var year = a.getFullYear();
- var month = months[a.getMonth()];
- var date = a.getDate();
- var hour = a.getHours();
- var min = a.getMinutes();
- var sec = a.getSeconds();
- var suffix = 'th';
if date == 1 || date == 21 || date == 31
- suffix = 'st';
if date == 2 || date == 22 || date == 32
- suffix = 'nd';
if date == 3 || date == 23
- suffix = 'rd';
if hour < 10
- hour = '0' + hour;
if min < 10
- min = '0' + min;
if sec < 10
- sec = '0' + sec;
- return date + suffix + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec + ' GMT';
- };
function format_unixtime(unixtime, alt) {
if (alt == null)
alt = false;
// check if this date should be displayed in utc or local timezone
if (('#{settings.shared_pages.date_time.timezone}'.toLowerCase() == 'local' && !alt) || ('#{settings.shared_pages.date_time.timezone}'.toLowerCase() == 'utc' && alt))
return luxon.DateTime.fromSeconds(unixtime).toLocal().toFormat('#{settings.shared_pages.date_time.display_format}');
else
return luxon.DateTime.fromSeconds(unixtime).toUTC().toFormat('#{settings.shared_pages.date_time.display_format}');
}
+15 -3
View File
@@ -68,13 +68,13 @@ block content
var amount = Number(data[4]).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true}); //variables for better readability
var amountParts = amount.split('.');
var amount = amountParts[0] + '.<span class="decimal">' + amountParts[1] + '</span>';
var timestamp = new Date(data[5] * 1000).toUTCString();
var timestamp = data[5];
$("td:eq(0)", row).html('<a href="/tx/' + txhash + '"><span class="fa fa-eye" data-toggle="tooltip" data-placement="top" title="#{settings.locale.view_tx}"></span></a>').addClass('text-center d-table-cell d-md-none');
$("td:eq(1)", row).html('<a href="/block/' + blockhash + '">' + blockindex + '</a>');
$("td:eq(2)", row).html('<a href="/tx/' + txhash + '">' + txhash + '</a>').addClass("text-center breakWord d-none d-md-table-cell");
$("td:eq(3)", row).html(outputs).addClass("text-center d-none d-sm-table-cell");
$("td:eq(4)", row).html(amount);
$("td:eq(5)", row).html(format_unixtime(new Date(timestamp), true)).addClass("text-center");
$("td:eq(5)", row).html('<span' + (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true ? ' data-toggle="tooltip" data-placement="auto" title="' + format_unixtime(timestamp, true) + '"' : '') + '>' + format_unixtime(timestamp) + '</span>').addClass('text-center');
},
fnDrawCallback: function(settings) {
fixDataTableColumns();
@@ -88,6 +88,18 @@ block content
rtable.api().ajax.reload(null, false);
}, (setting_reload_table_seconds * 1000) );
}
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
if error !== null
.col-12
@@ -100,7 +112,7 @@ block content
.col-md-12.cardSpacer
if settings.index_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Blockchain data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
.card.card-default.border-0.cardSpacer
.card-header
strong #{settings.locale.ex_latest_transactions}
+31 -3
View File
@@ -2,6 +2,20 @@ extends layout
block content
include ./includes/common.pug
script.
$(document).ready(function() {
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.shared_pages.table_header_bgcolor);
@@ -45,6 +59,20 @@ block content
}
},
fnDrawCallback: function(settings) {
if ($('#history-table > tbody > tr > td > span.timestampCol').length > 0) {
$('#history-table > tbody > tr > td > span.timestampCol').each(function() {
if ($.isNumeric($(this).text())) {
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true)
$(this).attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(parseInt($(this).text()), true));
$(this).html(format_unixtime(parseInt($(this).text())));
}
});
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true)
enableTooltips();
}
fixDataTableColumns();
}
});
@@ -52,7 +80,7 @@ block content
.col-xs-12.col-md-12
if settings.markets_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Market data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
if settings.markets_page.show_market_select == true && settings.market_count > 1
.row
.col-md-12.cardSpacer
@@ -348,7 +376,7 @@ block content
td.text-center #{splitTotal[0]}.
span.decimal #{splitTotal[1]}
td.text-center
=format_unixtime(new Date(order.timestamp), true)
span.timestampCol=order.timestamp
else
tr
td.text-center.text-danger.font-weight-bold #{splitPrice[0]}.
@@ -358,7 +386,7 @@ block content
td.text-center #{splitTotal[0]}.
span.decimal #{splitTotal[1]}
td.text-center
=format_unixtime(new Date(order.timestamp), true)
span.timestampCol=order.timestamp
else
.alert.alert-danger.alert-dismissable(role='alert')
button.close(type='button', data-dismiss='alert') ×
+18 -4
View File
@@ -51,9 +51,10 @@ block content
for (i = 0; i < json.length; i++) {
var addr = json[i]['addr'];
json[i]['address'] = "<a href='/address/" + json[i]['address'] + "'>" + json[i]['address'] + "</a>";
json[i]['lastseen'] = new Date((json[i]['lastseen']) * 1000).toLocaleString();
if (typeof json[i]['lastpaid'] != 'undefined')
json[i]['lastpaid'] = new Date((json[i]['lastpaid']) * 1000).toLocaleString();
json[i]['lastseen'] = '<span' + (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true ? ' data-toggle="tooltip" data-placement="auto" title="' + format_unixtime(json[i]['lastseen'], true) + '"' : '') + '>' + format_unixtime(json[i]['lastseen']) + '</span>';
if (typeof json[i]['lastpaid'] != 'undefined' && json[i]['lastpaid'] != '' && json[i]['lastpaid'] != '0')
json[i]['lastpaid'] = '<span' + (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true ? ' data-toggle="tooltip" data-placement="auto" title="' + format_unixtime(json[i]['lastpaid'], true) + '"' : '') + '>' + format_unixtime(json[i]['lastpaid']) + '</span>';
else
json[i]['lastpaid'] = '<em>N/A</em>';
if (json[i]['activetime'])
@@ -103,15 +104,28 @@ block content
fnDrawCallback: function(settings) {
fixDataTableColumns();
fixFooterHeightAndPosition();
enableTooltips();
}
});
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
.col-md-12.cardSpacer
.text-center(style='margin-bottom:15px;')
i The current listing of all masternodes known to be active on the network.
if settings.masternodes_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Masternode list last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
.card.card-default
.card-header
strong Masternodes
+16 -3
View File
@@ -67,12 +67,12 @@ block content
var amount = data[4]; //variables for better readability
var amountParts = Number(amount).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true}).split('.');
var amountStr = amountParts[0] + '.<span class="decimal">' + amountParts[1] + '</span>';
var timestamp = new Date(data[5] * 1000).toUTCString(); //variables for better readability
var timestamp = data[5]; //variables for better readability
var total = "<label class='badge badge-" + (amount > '#{settings.movement_page.movement_table.high_warning_flag}' ? 'danger' : (amount > '#{settings.movement_page.movement_table.low_warning_flag}' ? 'warning' : 'success')) + "' style='margin-bottom:0;'>" + amountStr + "</label>";
$("td:eq(0)", row).html('<a href="/tx/' + txhash + '"><span class="fa fa-eye" data-toggle="tooltip" data-placement="top" title="#{settings.locale.view_tx}"></span></a>').addClass('text-center d-table-cell d-md-none');
$("td:eq(1)", row).html('<a href="/tx/' + txhash + '">' + txhash + '</a>').addClass('breakWord d-none d-md-table-cell');
$("td:eq(2)", row).html(total).addClass('text-center');
$("td:eq(3)", row).html(format_unixtime(new Date(timestamp), true)).addClass('text-center');
$("td:eq(3)", row).html('<span' + (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true ? ' data-toggle="tooltip" data-placement="auto" title="' + format_unixtime(timestamp, true) + '"' : '') + '>' + format_unixtime(timestamp) + '</span>').addClass('text-center');
},
fnDrawCallback: function(settings) {
fixDataTableColumns();
@@ -80,17 +80,30 @@ block content
enableTooltips();
}
});
var setting_reload_table_seconds = parseInt("#{settings.movement_page.movement_table.reload_table_seconds}");
if (setting_reload_table_seconds > 0) {
setInterval( function () {
rtable.api().ajax.reload(null, false);
}, (setting_reload_table_seconds * 1000) );
}
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
.col-md-12
if settings.movement_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Blockchain data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
.card.card-default.border-0.cardSpacer
.card-header
strong="Latest Movement"
+13 -1
View File
@@ -143,6 +143,18 @@ block content
fixDataTableColumns();
fixFooterHeightAndPosition();
});
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
@@ -153,7 +165,7 @@ block content
.container
if settings.network_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Network data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
ul.nav.nav-tabs(role='tablist')
li.nav-item(role='presentation')
a.nav-link.active(href='#connections', aria-controls='connections', role='tab', data-toggle='tab') #{settings.locale.net_connections}
+13 -1
View File
@@ -15,12 +15,24 @@ block content
fixDataTableColumns();
}
});
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
.row(style='margin-left:0;margin-right:0;')
.col-xs-12.col-md-12
if settings.blockchain_specific.heavycoin.reward_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Reward data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
.card.card-default.border-0.card-address-summary
.card-header(style='position:relative;')
strong #{settings.locale.heavy_title}
+13 -1
View File
@@ -39,6 +39,18 @@ block content
}
}
);
var lastUpdatedDate = #{(last_updated == null || last_updated == '0' ? 0 : last_updated)};
if (lastUpdatedDate != 0) {
$('span#lastUpdatedDate').html(' ' + format_unixtime(lastUpdatedDate));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#lastUpdatedDate').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(lastUpdatedDate, true));
enableTooltips();
}
} else
$('span#lastUpdatedDate').html(' N/A');
});
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
@@ -49,7 +61,7 @@ block content
.container
if settings.richlist_page.show_last_updated == true
div.font-weight-bold(style='margin-bottom:15px;') Top 100 data last updated:
span.font-weight-normal=(last_updated == null || last_updated == '0' ? ' N/A' : ' ' + format_unixtime(last_updated))
span#lastUpdatedDate.font-weight-normal
ul.nav.nav-tabs(role='tablist')
if settings.richlist_page.show_current_balance == true
li.nav-item(role='presentation')
+15 -4
View File
@@ -2,10 +2,18 @@ extends layout
block content
include ./includes/common.pug
- var time = format_unixtime(tx.timestamp);
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.shared_pages.table_header_bgcolor);
script.
$(document).ready(function() {
$('span#timestampCol').html(format_unixtime(#{tx.timestamp}));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#timestampCol').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(#{tx.timestamp}, true));
enableTooltips();
}
});
.col-xs-12.col-md-12
.card.card-default.border-0.cardSpacer
.card-header
@@ -30,7 +38,8 @@ block content
td.d-none.d-md-table-cell
a.breakWord(href='/block/' + tx.blockhash) #{tx.blockhash}
td.text-center #{confirms}
td.text-center #{time}
td.text-center
span#timestampCol
else
if confirms < (confirmations / 2)
tr.bg-danger
@@ -40,7 +49,8 @@ block content
td.d-none.d-md-table-cell
a.breakWord(href='/block/' + tx.blockhash) #{tx.blockhash}
td.text-center #{confirms}
td.text-center #{time}
td.text-center
span#timestampCol
else
tr.table-warning
td.text-center.d-table-cell.d-md-none
@@ -49,7 +59,8 @@ block content
td.d-none.d-md-table-cell
a.breakWord(href='/block/' + tx.blockhash) #{tx.blockhash}
td.text-center #{confirms}
td.text-center #{time}
td.text-center
span#timestampCol
if tx.vout.length < 1
.alert.alert-info.text-center(role='alert', style='margin-bottom:0;')
strong #{settings.locale.tx_nonstandard}