Ver código fonte

fix total duration formatting: days

HOME 2 anos atrás
pai
commit
5779c7b795

+ 10 - 0
FNZCM/FNZCM.ConHost/publish.bat

@@ -0,0 +1,10 @@
+dotnet publish ^
+	-c Release ^
+	-p:PublishDir=W:\ToysRelease\FNZCM.ConHost ^
+	-p:EnableCompressionInSingleFile=true ^
+	-p:TargetFramework=net7.0 ^
+	-r win-x64 ^
+	--self-contained true ^
+	-p:PublishSingleFile=true ^
+	-p:PublishReadyToRun=false ^
+	-p:PublishTrimmed=false

+ 5 - 3
FNZCM/FNZCM.Shared/Helpers/HumanReadHelper.cs

@@ -10,9 +10,11 @@
             if (sec.HasValue == false) return string.Empty;
             var ts = TimeSpan.FromSeconds(sec.Value);
 
-            return ts.Hours > 0
-                ? $"{Math.Floor(ts.TotalHours):00}:{ts.Minutes:00}:{ts.Seconds:00}"
-                : $"{Math.Floor(ts.TotalMinutes):00}:{ts.Seconds:00}";
+            return Math.Floor(ts.TotalDays) >= 1
+                ? $"{Math.Floor(ts.TotalDays):00}.{ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}"
+                : Math.Floor(ts.TotalHours) >= 1
+                    ? $"{Math.Floor(ts.TotalHours):00}:{ts.Minutes:00}:{ts.Seconds:00}"
+                    : $"{Math.Floor(ts.TotalMinutes):00}:{ts.Seconds:00}";
         }
 
         public static string BytesToFileSize(this long length) => ((long?)length).BytesToFileSize();