From 0a04a77a8997bb84134d770304cf317edfc7ec48 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 14 May 2020 15:47:01 +0700 Subject: [PATCH] Allow building with the macOS 10.14 SDK This does mean that NSRelativeDateTimeFormatter is not used, even when running on macOS 10.15. --- Frameworks/Preferences/src/BundlesPreferences.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Frameworks/Preferences/src/BundlesPreferences.mm b/Frameworks/Preferences/src/BundlesPreferences.mm index cb341b5a..32478f33 100644 --- a/Frameworks/Preferences/src/BundlesPreferences.mm +++ b/Frameworks/Preferences/src/BundlesPreferences.mm @@ -56,8 +56,10 @@ static NSUserInterfaceItemIdentifier const kTableColumnIdentifierDescription = @ if(NSDate* date = [NSUserDefaults.standardUserDefaults objectForKey:kUserDefaultsLastBundleUpdateCheckKey]) { NSString* dateString = [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle]; +#if defined(MAC_OS_X_VERSION_10_15) && (MAC_OS_X_VERSION_10_15 <= MAC_OS_X_VERSION_MAX_ALLOWED) if(@available(macos 10.15, *)) dateString = -[date timeIntervalSinceNow] < 5 ? @"Just now" : [[[NSRelativeDateTimeFormatter alloc] init] localizedStringForDate:date relativeToDate:NSDate.now]; +#endif return [NSString stringWithFormat:@"Bundle index last updated: %@", dateString]; }