From cf373634d71e146c2f18130a4235058da9989d58 Mon Sep 17 00:00:00 2001 From: junepark678 <40409848+junepark678@users.noreply.github.com> Date: Sat, 25 Nov 2023 13:34:23 +0900 Subject: [PATCH] bugfix(App IDs, My Apps): calculate in correct direction in time (we aren't time travelers) --- AltStore/App IDs/AppIDsViewController.swift | 4 ++-- AltStore/My Apps/MyAppsViewController.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AltStore/App IDs/AppIDsViewController.swift b/AltStore/App IDs/AppIDsViewController.swift index 947a2fa7..d575098e 100644 --- a/AltStore/App IDs/AppIDsViewController.swift +++ b/AltStore/App IDs/AppIDsViewController.swift @@ -98,11 +98,11 @@ private extension AppIDsViewController formatter.allowedUnits = [.minute, .hour, .day] - cell.bannerView.button.setTitle(formatter.string(from: expirationDate, to: Date())?.uppercased(), for: .normal) + cell.bannerView.button.setTitle(formatter.string(from: Date(), to: expirationDate)?.uppercased(), for: .normal) formatter.includesTimeRemainingPhrase = true - attributedAccessibilityLabel.mutableString.append((formatter.string(from: expirationDate, to: Date()) ?? NSLocalizedString("Unknown", comment: "")) + " ") + attributedAccessibilityLabel.mutableString.append((formatter.string(from: Date(), to: expirationDate) ?? NSLocalizedString("Unknown", comment: "")) + " ") } else { diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index 19876892..79e29153 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -336,13 +336,13 @@ private extension MyAppsViewController 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(formatter.string(from: currentDate, to: installedApp.expirationDate)?.uppercased(), for: .normal) cell.bannerView.button.accessibilityLabel = String(format: NSLocalizedString("Refresh %@", comment: ""), installedApp.name) formatter.includesTimeRemainingPhrase = true - cell.bannerView.accessibilityLabel? += ". " + (formatter.string(from: installedApp.expirationDate, to: currentDate) ?? NSLocalizedString("Unknown", comment: "")) + " " + cell.bannerView.accessibilityLabel? += ". " + (formatter.string(from: currentDate, to: installedApp.expirationDate) ?? NSLocalizedString("Unknown", comment: "")) + " " // Make sure refresh button is correct size. cell.layoutIfNeeded()