diff --git a/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj b/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj index 313d6e23..9990fdfa 100644 --- a/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj +++ b/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj @@ -1430,7 +1430,7 @@ CODE_SIGN_ENTITLEMENTS = ACHNBrowserUI/ACHNBrowserUI.entitlements; CODE_SIGN_IDENTITY = "Apple Development: Thomas Ricouard (7MB55D6BJ5)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 070512020; + CURRENT_PROJECT_VERSION = 070812020; DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\""; DEVELOPMENT_TEAM = Z6P74P6T99; ENABLE_PREVIEWS = YES; @@ -1440,7 +1440,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.8.2; + MARKETING_VERSION = 1.8.3; PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH; PRODUCT_NAME = "AC Helper"; PROVISIONING_PROFILE_SPECIFIER = "AC Dev"; @@ -1461,7 +1461,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 070512020; + CURRENT_PROJECT_VERSION = 070812020; DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\""; DEVELOPMENT_TEAM = Z6P74P6T99; ENABLE_PREVIEWS = YES; @@ -1471,7 +1471,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.8.2; + MARKETING_VERSION = 1.8.3; PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH; PRODUCT_NAME = "AC Helper"; PROVISIONING_PROFILE_SPECIFIER = "AC Dev"; diff --git a/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift b/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift index f46f9ed0..50339aaa 100644 --- a/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift +++ b/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift @@ -207,7 +207,7 @@ public extension Item { return "\(startHour) - \(endHour)\(is24Hour() ? "h" : "")" } - private func activeHours() -> (start: Int, end: Int)? { + func activeHours() -> (start: Int, end: Int)? { guard let activeTimes = activeMonths?.first?.value.activeTimes, let startTime = activeTimes.first, let endTime = activeTimes.last else { @@ -216,23 +216,28 @@ public extension Item { if Int(startTime) == 0 && Int(endTime) == 0 { return (start: 0, end: 0) } - + var startHourInt = 0 var endHourInt = 0 - if let hour = Int(startTime.prefix(1)) { + + var preIntStartTime = startTime + preIntStartTime.removeLast(2) + if let hour = Int(preIntStartTime) { startHourInt = hour if startTime.suffix(2) == "pm" { startHourInt += 12 } } - - if let hour = Int(endTime.prefix(1)) { + + var preIntEndTime = endTime + preIntEndTime.removeLast(2) + if let hour = Int(preIntEndTime) { endHourInt = hour if endTime.suffix(2) == "pm" { endHourInt += 12 } } - + return (start: startHourInt, end: endHourInt) } }