summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-08-10 18:50:46 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 19:13:11 -0400
commit86b2fef8ce5295e4572f78af65053d418171ad37 (patch)
treecb45d2f80967a2394900c3c70364db39d579bdac /src/SMAPI.Web/Views
parentcff42300bc9e2862585e81ef5be00c90fa17d24a (diff)
downloadSMAPI-86b2fef8ce5295e4572f78af65053d418171ad37.tar.gz
SMAPI-86b2fef8ce5295e4572f78af65053d418171ad37.tar.bz2
SMAPI-86b2fef8ce5295e4572f78af65053d418171ad37.zip
better handle stale age label on mod compatibility list
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r--src/SMAPI.Web/Views/Mods/Index.cshtml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml
index aa7c0678..50b59b45 100644
--- a/src/SMAPI.Web/Views/Mods/Index.cshtml
+++ b/src/SMAPI.Web/Views/Mods/Index.cshtml
@@ -1,7 +1,11 @@
+@using Humanizer
+@using Humanizer.Localisation
@using Newtonsoft.Json
@model StardewModdingAPI.Web.ViewModels.ModListModel
@{
ViewData["Title"] = "Mod compatibility";
+
+ TimeSpan staleAge = DateTimeOffset.UtcNow - Model.LastUpdated;
}
@section Head {
<link rel="stylesheet" href="~/Content/css/mods.css?r=20190302" />
@@ -26,7 +30,7 @@ else
{
@if (Model.IsStale)
{
- <div class="error">Showing data from @(Math.Round((DateTimeOffset.UtcNow - Model.LastUpdated).TotalMinutes)) minutes ago. (Couldn't fetch newer data; the wiki API may be offline.)</div>
+ <div class="error">Showing data from @staleAge.Humanize(maxUnit: TimeUnit.Hour, minUnit: TimeUnit.Minute) ago. (Couldn't fetch newer data; the wiki API may be offline.)</div>
}
<div id="app">