From 2c638fe6810aa14708580e4498253d6ba2c9f41d Mon Sep 17 00:00:00 2001 From: Abhijith Vijayan <34790378+abhijithvijayan@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:02:42 +0530 Subject: [PATCH] fix: negative days shown for expired apps Signed-off-by: Abhijith Vijayan [KUBRIC] --- AltStore/My Apps/MyAppsViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 7a05c658a..872d0ee51 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -336,7 +336,8 @@ private extension MyAppsViewController let currentDate = Date() - let numberOfDays = installedApp.expirationDate.numberOfCalendarDays(since: currentDate) + // calculate number of days left relative to current date with negative values ignored + let numberOfDays = max(installedApp.expirationDate.numberOfCalendarDays(since: currentDate), 0) let numberOfDaysText: String if numberOfDays == 1