Skip to content

Commit 5d07493

Browse files
committed
Fix critters time
1 parent ad69b90 commit 5d07493

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@
14301430
CODE_SIGN_ENTITLEMENTS = ACHNBrowserUI/ACHNBrowserUI.entitlements;
14311431
CODE_SIGN_IDENTITY = "Apple Development: Thomas Ricouard (7MB55D6BJ5)";
14321432
CODE_SIGN_STYLE = Manual;
1433-
CURRENT_PROJECT_VERSION = 070512020;
1433+
CURRENT_PROJECT_VERSION = 070812020;
14341434
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
14351435
DEVELOPMENT_TEAM = Z6P74P6T99;
14361436
ENABLE_PREVIEWS = YES;
@@ -1440,7 +1440,7 @@
14401440
"$(inherited)",
14411441
"@executable_path/Frameworks",
14421442
);
1443-
MARKETING_VERSION = 1.8.2;
1443+
MARKETING_VERSION = 1.8.3;
14441444
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH;
14451445
PRODUCT_NAME = "AC Helper";
14461446
PROVISIONING_PROFILE_SPECIFIER = "AC Dev";
@@ -1461,7 +1461,7 @@
14611461
CODE_SIGN_IDENTITY = "iPhone Developer";
14621462
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
14631463
CODE_SIGN_STYLE = Manual;
1464-
CURRENT_PROJECT_VERSION = 070512020;
1464+
CURRENT_PROJECT_VERSION = 070812020;
14651465
DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\"";
14661466
DEVELOPMENT_TEAM = Z6P74P6T99;
14671467
ENABLE_PREVIEWS = YES;
@@ -1471,7 +1471,7 @@
14711471
"$(inherited)",
14721472
"@executable_path/Frameworks",
14731473
);
1474-
MARKETING_VERSION = 1.8.2;
1474+
MARKETING_VERSION = 1.8.3;
14751475
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH;
14761476
PRODUCT_NAME = "AC Helper";
14771477
PROVISIONING_PROFILE_SPECIFIER = "AC Dev";

ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public extension Item {
207207
return "\(startHour) - \(endHour)\(is24Hour() ? "h" : "")"
208208
}
209209

210-
private func activeHours() -> (start: Int, end: Int)? {
210+
func activeHours() -> (start: Int, end: Int)? {
211211
guard let activeTimes = activeMonths?.first?.value.activeTimes,
212212
let startTime = activeTimes.first,
213213
let endTime = activeTimes.last else {
@@ -216,23 +216,28 @@ public extension Item {
216216
if Int(startTime) == 0 && Int(endTime) == 0 {
217217
return (start: 0, end: 0)
218218
}
219-
219+
220220
var startHourInt = 0
221221
var endHourInt = 0
222-
if let hour = Int(startTime.prefix(1)) {
222+
223+
var preIntStartTime = startTime
224+
preIntStartTime.removeLast(2)
225+
if let hour = Int(preIntStartTime) {
223226
startHourInt = hour
224227
if startTime.suffix(2) == "pm" {
225228
startHourInt += 12
226229
}
227230
}
228-
229-
if let hour = Int(endTime.prefix(1)) {
231+
232+
var preIntEndTime = endTime
233+
preIntEndTime.removeLast(2)
234+
if let hour = Int(preIntEndTime) {
230235
endHourInt = hour
231236
if endTime.suffix(2) == "pm" {
232237
endHourInt += 12
233238
}
234239
}
235-
240+
236241
return (start: startHourInt, end: endHourInt)
237242
}
238243
}

0 commit comments

Comments
 (0)