Commit eb7d137e authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Fix.

parent 7c63666e
Pipeline #590 canceled with stages
......@@ -161,16 +161,24 @@ export class Utility {
);
});
$(".utc-date").each(function () {
$(this).text(
Utility.toLocalTimezone(
new Date($(this).text())
).toString()
);
});
}
public static toUtcDate(date : Date): number {
public static toUtcDate(date: Date): number {
return Date.UTC(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),
date.getUTCMilliseconds()
);
}
......
......@@ -154,7 +154,7 @@ namespace StatusMonitor.Shared.Services
return
unresolved == 0 ?
"There are no outstanding issues. Well done." :
$"There {(unresolved == 1 ? "is" : "are")} still outstanding {unresolved} issue{(unresolved == 1 ? "" : "s")}."
$"There {(unresolved == 1 ? "is" : "are")} still outstanding {unresolved} issue{(unresolved == 1 ? "" : "s")}. See admin panel."
;
}
......
......@@ -12,6 +12,8 @@ namespace StatusMonitor.Web.TagHelpers
/// </summary>
public class UtcTimeTagHelper : TagHelper
{
public bool ShowDate { get; set; } = false;
public DateTime Time { get; set; }
[ViewContext]
......@@ -26,7 +28,8 @@ namespace StatusMonitor.Web.TagHelpers
output.TagMode = TagMode.StartTagAndEndTag;
output.Attributes.Clear();
output.Attributes.Add("class", "utc-time");
output.Attributes.Add("class", ShowDate ? "utc-date" : "utc-time");
output.Content.SetHtmlContent(Time.ToString());
......
@using StatusMonitor.Shared.Models.Entities
@using Microsoft.Extensions.Configuration
@inject IConfiguration Config
@{
ViewData["Title"] = "Admin panel";
......@@ -111,7 +114,10 @@
<div class="card-header">
<h2>Discrepancies
<small>
View the list of resolved and unresolved dicrepancies from TODO until now
@{
var discrepancyDataStartDate = DateTime.UtcNow - new TimeSpan(0, 0, Convert.ToInt32(Config["ServiceManager:CleanService:MaxAge"]));
}
View the list of resolved and unresolved dicrepancies from <utc-time time="@discrepancyDataStartDate" show-date=true /> until now.
</small>
</h2>
</div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment