diff --git a/AltStore.xcodeproj/project.pbxproj b/AltStore.xcodeproj/project.pbxproj index f4dfb79d..233463c5 100644 --- a/AltStore.xcodeproj/project.pbxproj +++ b/AltStore.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 57de2c8e..19876892 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -329,21 +329,20 @@ private extension MyAppsViewController let currentDate = Date() let numberOfDays = installedApp.expirationDate.numberOfCalendarDays(since: currentDate) - let numberOfDaysText: String - if numberOfDays == 1 - { - numberOfDaysText = NSLocalizedString("1 day", comment: "") - } - else - { - numberOfDaysText = String(format: NSLocalizedString("%@ days", comment: ""), NSNumber(value: numberOfDays)) - } + let formatter = DateComponentsFormatter() + formatter.unitsStyle = .full + formatter.includesApproximationPhrase = false + formatter.includesTimeRemainingPhrase = false + formatter.allowedUnits = [.minute, .hour, .day] + + cell.bannerView.button.setTitle(formatter.string(from: installedApp.expirationDate, to: currentDate)?.uppercased(), for: .normal) - cell.bannerView.button.setTitle(numberOfDaysText.uppercased(), for: .normal) cell.bannerView.button.accessibilityLabel = String(format: NSLocalizedString("Refresh %@", comment: ""), installedApp.name) - - cell.bannerView.accessibilityLabel? += ". " + String(format: NSLocalizedString("Expires in %@", comment: ""), numberOfDaysText) + + formatter.includesTimeRemainingPhrase = true + + cell.bannerView.accessibilityLabel? += ". " + (formatter.string(from: installedApp.expirationDate, to: currentDate) ?? NSLocalizedString("Unknown", comment: "")) + " " // Make sure refresh button is correct size. cell.layoutIfNeeded()