mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +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.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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user