From 86b2fef8ce5295e4572f78af65053d418171ad37 Mon Sep 17 00:00:00 2001
From: Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com>
Date: Sat, 10 Aug 2019 18:50:46 -0400
Subject: better handle stale age label on mod compatibility list

---
 src/SMAPI.Web/Views/Mods/Index.cshtml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/SMAPI.Web/Views')

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">
-- 
cgit