From a32422bb5ee06ba0c4136efc2eafe3d302682792 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Thu, 26 Feb 2026 04:30:48 +0100 Subject: [PATCH] chore: remove unused formatRelativeTime --- lib/utils/formatters.dart | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/lib/utils/formatters.dart b/lib/utils/formatters.dart index efcd7ac5..40cb1d63 100644 --- a/lib/utils/formatters.dart +++ b/lib/utils/formatters.dart @@ -185,43 +185,6 @@ String formatFinishTime(Duration remaining, {double rate = 1.0}) { return formatter.format(finishTime); } -/// Formats a DateTime as a relative time string (e.g., "just now", "5m", "3h", "2d", or a full date). -/// Uses the `duration` package for localized unit names. -/// -/// Used for: recent connections timestamps. -String formatRelativeTime(DateTime date) { - final now = DateTime.now(); - final difference = now.difference(date); - - if (difference.inMinutes < 1) { - return prettyDuration( - Duration.zero, - abbreviated: true, - locale: _getDurationLocale(), - tersity: DurationTersity.minute, - upperTersity: DurationTersity.minute, - ); - } else if (difference.inDays < 7) { - return prettyDuration( - difference, - abbreviated: true, - locale: _getDurationLocale(), - delimiter: ' ', - spacer: '', - tersity: DurationTersity.minute, - upperTersity: () { - if (difference.inDays >= 1) return DurationTersity.day; - if (difference.inHours >= 1) return DurationTersity.hour; - return DurationTersity.minute; - }(), - maxUnits: 1, - ); - } else { - final formatter = DateFormat.yMd(LocaleSettings.currentLocale.languageCode); - return formatter.format(date); - } -} - /// Takes a list of strings and returns one long string with each item in the list concatenated by a bullet String toBulletedString(List parts) { return parts.join(' ยท ');