From 27a9a2eebf23eb1407d9b2651d04cb32fddc97d0 Mon Sep 17 00:00:00 2001 From: Amos Date: Wed, 24 Jul 2024 18:52:02 +0100 Subject: [PATCH] Using Humaniser instead of fixed string... (#335) Update tooltip text generation in MetaRegistration The tooltip text generation in MetaRegistration.cs is updated to use Humanizer's 'HumanizeForCurrentCulture' method with 'TimeUnit.Hour' as maxUnit. This change leverages the Humanizer library to provide more precise and localized time formatting. --- Application/Meta/MetaRegistration.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application/Meta/MetaRegistration.cs b/Application/Meta/MetaRegistration.cs index 719ac641..a061a60f 100644 --- a/Application/Meta/MetaRegistration.cs +++ b/Application/Meta/MetaRegistration.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using Humanizer.Localisation; using Microsoft.Extensions.Logging; using ILogger = Microsoft.Extensions.Logging.ILogger; @@ -118,7 +119,7 @@ namespace IW4MAdmin.Application.Meta ClientId = client.ClientId, Key = _transLookup["WEBFRONT_PROFILE_META_PLAY_TIME"], Value = friendlyTime.HumanizeForCurrentCulture(), - ToolTipText = $"{friendlyTime.TotalHours:N1} hour(s)", + ToolTipText = friendlyTime.HumanizeForCurrentCulture(maxUnit: TimeUnit.Hour), ShouldDisplay = true, Order = 8, Type = MetaType.Information