From d122276e7193060e1eed9b4ccb7e766405033127 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Wed, 8 Oct 2025 22:09:09 -0300 Subject: [PATCH] feat: clean imports --- Flow.Launcher/Storage/HistoryItem.cs | 39 ---------------------------- 1 file changed, 39 deletions(-) diff --git a/Flow.Launcher/Storage/HistoryItem.cs b/Flow.Launcher/Storage/HistoryItem.cs index e8838d169..d7503108c 100644 --- a/Flow.Launcher/Storage/HistoryItem.cs +++ b/Flow.Launcher/Storage/HistoryItem.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Flow.Launcher.Plugin; namespace Flow.Launcher.Storage; @@ -17,39 +13,4 @@ public class HistoryItem public Func ExecuteAction { get; set; } public Func QueryAction { get; set; } - - public string GetTimeAgo() - { - return DateTimeAgo(ExecutedDateTime); - } - - private string DateTimeAgo(DateTime dt) - { - var span = DateTime.Now - dt; - if (span.Days > 365) - { - int years = (span.Days / 365); - if (span.Days % 365 != 0) - years += 1; - return $"about {years} {(years == 1 ? "year" : "years")} ago"; - } - if (span.Days > 30) - { - int months = (span.Days / 30); - if (span.Days % 31 != 0) - months += 1; - return $"about {months} {(months == 1 ? "month" : "months")} ago"; - } - if (span.Days > 0) - return $"about {span.Days} {(span.Days == 1 ? "day" : "days")} ago"; - if (span.Hours > 0) - return $"about {span.Hours} {(span.Hours == 1 ? "hour" : "hours")} ago"; - if (span.Minutes > 0) - return $"about {span.Minutes} {(span.Minutes == 1 ? "minute" : "minutes")} ago"; - if (span.Seconds > 5) - return $"about {span.Seconds} seconds ago"; - if (span.Seconds <= 5) - return "just now"; - return string.Empty; - } }