#1725 - Added start date & changed display timezone

This commit is contained in:
Alex Gidge 2021-03-07 22:51:50 +00:00
parent e31b5529b0
commit da95bd6127
5 changed files with 18 additions and 10 deletions

View File

@ -70,7 +70,8 @@ namespace BTCPayServer.Controllers
ClaimedAmount = amountDue,
AmountDueFormatted = _currencyNameTable.FormatCurrency(amountDue, blob.Currency),
CurrencyData = cd,
LastUpdated = DateTime.Now,
StartDate = pp.StartDate,
LastRefreshed = DateTime.Now,
Payouts = payouts
.Select(entity => new ViewPullPaymentModel.PayoutLine
{

View File

@ -76,7 +76,8 @@ namespace BTCPayServer.Models
public string EmbeddedCSS { get; set; }
public string CustomCSSLink { get; set; }
public List<PayoutLine> Payouts { get; set; } = new List<PayoutLine>();
public DateTime LastUpdated { get; set; }
public DateTimeOffset StartDate { get; set; }
public DateTime LastRefreshed { get; set; }
public CurrencyData CurrencyData { get; set; }
public string AmountCollectedFormatted { get; set; }
public string AmountFormatted { get; set; }

View File

@ -89,9 +89,14 @@
<h2 class="h4 mb-3">@Model.Title</h2>
}
<div class="d-flex align-items-center">
<span class="text-muted text-nowrap">Last Updated</span>
<span class="text-muted text-nowrap">Start Date</span>
&nbsp;
<span class="text-nowrap">@Model.LastUpdated.ToString("g")</span>
<span class="text-nowrap">@Model.StartDate.ToBrowserDate()</span>
</div>
<div class="d-flex align-items-center">
<span class="text-muted text-nowrap">Last Refreshed</span>
&nbsp;
<span class="text-nowrap">@Model.LastRefreshed.ToBrowserDate()</span>
<button type="button" class="btn btn-link d-none d-lg-inline-block d-print-none border-0 p-0 ml-4 only-for-js" id="copyLink">
Copy Link
</button>

View File

@ -28,7 +28,7 @@
{
<tr>
<td>@file.FileName</td>
<td>@file.Timestamp.ToBrowserDate2()</td>
<td>@file.Timestamp.ToBrowserDate()</td>
<td>@file.ApplicationUser.UserName</td>
<td>
<a asp-action="Files" asp-route-fileId="@file.Id">Get Link</a>

View File

@ -28,15 +28,16 @@ namespace BTCPayServer.Views
public static HtmlString ToBrowserDate(this DateTimeOffset date)
{
var hello = date.ToString("o", CultureInfo.InvariantCulture);
return new HtmlString($"<span class='localizeDate'>{hello}</span>");
var displayDate = date.ToString("g", CultureInfo.InvariantCulture);
return new HtmlString($"<span class='localizeDate'>{displayDate}</span>");
}
public static HtmlString ToBrowserDate2(this DateTime date)
public static HtmlString ToBrowserDate(this DateTime date)
{
var hello = date.ToString("o", CultureInfo.InvariantCulture);
return new HtmlString($"<span class='localizeDate'>{hello}</span>");
var displayDate = date.ToString("g", CultureInfo.InvariantCulture);
return new HtmlString($"<span class='localizeDate'>{displayDate}</span>");
}
public static string ToTimeAgo(this DateTimeOffset date)
{
var formatted = (DateTimeOffset.UtcNow - date).TimeString() + " ago";