From 65ef7bc6c9a18e7421468d0853d0c67369c01f97 Mon Sep 17 00:00:00 2001 From: moderndevslulw Date: Sun, 6 Jul 2025 02:06:25 +0500 Subject: feat: channel pages --- lib/utils.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/utils.php (limited to 'lib/utils.php') diff --git a/lib/utils.php b/lib/utils.php new file mode 100644 index 0000000..6de3dfb --- /dev/null +++ b/lib/utils.php @@ -0,0 +1,21 @@ + 1 ? "s" : ""); + } else if ($years == 0 && $days == 0 && $hours == 0) { + return "$minutes minute" . ($minutes > 1 ? "s" : ""); + } else if ($years == 0 && $days == 0) { + return "$hours hour" . ($hours > 1 ? "s" : ""); + } else if ($years == 0) { + return "$days day" . ($days > 1 ? "s" : ""); + } else { + return "$years year" . ($years > 1 ? "s" : ""); + } +} \ No newline at end of file -- cgit v1.2.3