Displaying switchable datetimes on wallet transactions page

This commit is contained in:
rockstardev 2019-04-25 18:22:04 -05:00 committed by Rockstar Developer
parent 64e7324285
commit c6091750b0
2 changed files with 23 additions and 4 deletions

View file

@ -28,17 +28,22 @@
</div>
<h4>@ViewData["Title"]</h4>
<div class="row">
<div class="col-md-10">
<div class="col-md-12">
If BTCPay Server shows you an invalid balance, <a asp-action="WalletRescan">rescan your wallet</a>. <br />
If some transactions appear in BTCPay Server, but are missing on Electrum or another wallet, <a href="https://docs.btcpayserver.org/faq-and-common-issues/faq-wallet#missing-payments-in-my-software-or-hardware-wallet">follow those instructions</a>.
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="col-md-12">
<table class="table table-sm table-responsive-lg">
<thead class="thead-inverse">
<tr>
<th>Timestamp</th>
<th style="min-width: 90px;" class="col-md-auto">
Date
<a href="javascript:switchTimeFormat()">
<span class="fa fa-clock-o" title="Switch date format"></span>
</a>
</th>
<th>Transaction Id</th>
<th style="text-align:right">Balance</th>
</tr>
@ -47,7 +52,11 @@
@foreach (var transaction in Model.Transactions)
{
<tr class="@(transaction.IsConfirmed ? "" : "unconf")">
<td>@transaction.Timestamp.ToTimeAgo()</td>
<td>
<span class="switchTimeFormat" data-switch="@transaction.Timestamp.ToTimeAgo()">
@transaction.Timestamp.ToBrowserDate()
</span>
</td>
<td class="smMaxWidth text-truncate">
<a href="@transaction.Link" target="_blank">
@transaction.Id

View file

@ -33,3 +33,13 @@
}
}
});
function switchTimeFormat() {
$(".switchTimeFormat").each(function (index) {
var htmlVal = $(this).html();
var switchVal = $(this).attr("data-switch");
$(this).html(switchVal);
$(this).attr("data-switch", htmlVal);
});
}