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

Fix.

parent 7c63666e
Pipeline #590 canceled with stages
...@@ -161,9 +161,17 @@ export class Utility { ...@@ -161,9 +161,17 @@ 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( return Date.UTC(
date.getUTCFullYear(), date.getUTCFullYear(),
date.getUTCMonth(), date.getUTCMonth(),
......
...@@ -154,7 +154,7 @@ namespace StatusMonitor.Shared.Services ...@@ -154,7 +154,7 @@ namespace StatusMonitor.Shared.Services
return return
unresolved == 0 ? unresolved == 0 ?
"There are no outstanding issues. Well done." : "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 ...@@ -12,6 +12,8 @@ namespace StatusMonitor.Web.TagHelpers
/// </summary> /// </summary>
public class UtcTimeTagHelper : TagHelper public class UtcTimeTagHelper : TagHelper
{ {
public bool ShowDate { get; set; } = false;
public DateTime Time { get; set; } public DateTime Time { get; set; }
[ViewContext] [ViewContext]
...@@ -26,7 +28,8 @@ namespace StatusMonitor.Web.TagHelpers ...@@ -26,7 +28,8 @@ namespace StatusMonitor.Web.TagHelpers
output.TagMode = TagMode.StartTagAndEndTag; output.TagMode = TagMode.StartTagAndEndTag;
output.Attributes.Clear(); output.Attributes.Clear();
output.Attributes.Add("class", "utc-time");
output.Attributes.Add("class", ShowDate ? "utc-date" : "utc-time");
output.Content.SetHtmlContent(Time.ToString()); output.Content.SetHtmlContent(Time.ToString());
......
@using StatusMonitor.Shared.Models.Entities @using StatusMonitor.Shared.Models.Entities
@using Microsoft.Extensions.Configuration
@inject IConfiguration Config
@{ @{
ViewData["Title"] = "Admin panel"; ViewData["Title"] = "Admin panel";
...@@ -111,7 +114,10 @@ ...@@ -111,7 +114,10 @@
<div class="card-header"> <div class="card-header">
<h2>Discrepancies <h2>Discrepancies
<small> <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> </small>
</h2> </h2>
</div> </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