From f4bd3074216454df64efd59ddb6a426342da6270 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 8 Mar 2023 16:47:27 -0800 Subject: [PATCH] Added comments, removed gthe AgeFormat() helper method Signed-off-by: snipe --- app/Helpers/Helper.php | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 9c7ca068c3..3692c9c1f7 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -1130,32 +1130,20 @@ class Helper return $bytes; } + + /** + * This is weird but used by the side nav to determine which URL to point the user to + * + * @author A. Gianotto + * @since 5.0 + * + * @return string[] + */ public static function SettingUrls(){ $settings=['#','fields.index', 'statuslabels.index', 'models.index', 'categories.index', 'manufacturers.index', 'suppliers.index', 'departments.index', 'locations.index', 'companies.index', 'depreciations.index']; return $settings; } - public static function AgeFormat($date) { - $year = Carbon::parse($date) - ->diff(now())->y; - $month = Carbon::parse($date) - ->diff(now())->m; - $days = Carbon::parse($date) - ->diff(now())->d; - $age=''; - if ($year) { - $age .= $year.'y '; - } - if ($month) { - $age .= $month.'m '; - } - if ($days) { - $age .= $days.'d'; - } - - return $age; - - } /**