mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
bugfix(App IDs, My Apps): display only necessary information
This commit is contained in:
committed by
nythepegasus
parent
cf373634d7
commit
9e2b9b6639
@@ -97,6 +97,15 @@ private extension AppIDsViewController
|
|||||||
formatter.includesTimeRemainingPhrase = false
|
formatter.includesTimeRemainingPhrase = false
|
||||||
formatter.allowedUnits = [.minute, .hour, .day]
|
formatter.allowedUnits = [.minute, .hour, .day]
|
||||||
|
|
||||||
|
let numberOfDays = expirationDate.numberOfCalendarDays(since: Date())
|
||||||
|
|
||||||
|
|
||||||
|
switch numberOfDays
|
||||||
|
{
|
||||||
|
case 1...: formatter.allowedUnits = [.day]
|
||||||
|
case 0: formatter.allowedUnits = [.hour, .minute]
|
||||||
|
default: formatter.allowedUnits = [.day]
|
||||||
|
}
|
||||||
|
|
||||||
cell.bannerView.button.setTitle(formatter.string(from: Date(), to: expirationDate)?.uppercased(), for: .normal)
|
cell.bannerView.button.setTitle(formatter.string(from: Date(), to: expirationDate)?.uppercased(), for: .normal)
|
||||||
|
|
||||||
|
|||||||
@@ -334,8 +334,15 @@ private extension MyAppsViewController
|
|||||||
formatter.unitsStyle = .full
|
formatter.unitsStyle = .full
|
||||||
formatter.includesApproximationPhrase = false
|
formatter.includesApproximationPhrase = false
|
||||||
formatter.includesTimeRemainingPhrase = false
|
formatter.includesTimeRemainingPhrase = false
|
||||||
formatter.allowedUnits = [.minute, .hour, .day]
|
switch numberOfDays
|
||||||
|
{
|
||||||
|
case 1...: formatter.allowedUnits = [.day]
|
||||||
|
case 0: formatter.allowedUnits = [.hour, .minute]
|
||||||
|
default: formatter.allowedUnits = [.day]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cell.bannerView.button.setTitle(formatter.string(from: currentDate, to: installedApp.expirationDate)?.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)
|
cell.bannerView.button.accessibilityLabel = String(format: NSLocalizedString("Refresh %@", comment: ""), installedApp.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user