From 705563ced99694dbc05d0c2d2583081575fdfc62 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Sun, 27 Oct 2024 14:53:38 -0400 Subject: [PATCH 1/2] Upgrade PromiseKit to 8.1.2. Partial #613 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Package.resolved | 4 ++-- Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 80d3efe..b8cf4ef 100644 --- a/Package.resolved +++ b/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mxcl/PromiseKit.git", "state" : { - "revision" : "8a98e31a47854d3180882c8068cc4d9381bf382d", - "version" : "6.22.1" + "revision" : "6fcc08077124e9747f1ec7bd8bb78f5caffe5a79", + "version" : "8.1.2" } }, { diff --git a/Package.swift b/Package.swift index c86eb3d..79429f6 100644 --- a/Package.swift +++ b/Package.swift @@ -20,7 +20,7 @@ let package = Package( .package(url: "https://github.com/Quick/Nimble.git", from: "10.0.0"), .package(url: "https://github.com/Quick/Quick.git", from: "5.0.1"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.22.1"), + .package(url: "https://github.com/mxcl/PromiseKit.git", from: "8.1.2"), .package(url: "https://github.com/mxcl/Version.git", from: "2.1.0"), .package(url: "https://github.com/sharplet/Regex.git", from: "2.1.1"), ], From e79e6283ac90272a738e57f32dd8e1ff744d7297 Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Sun, 27 Oct 2024 14:54:07 -0400 Subject: [PATCH 2/2] Use `ISO8601DateFormatter`. Resolve #613 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Sources/mas/Formatters/AppInfoFormatter.swift | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Sources/mas/Formatters/AppInfoFormatter.swift b/Sources/mas/Formatters/AppInfoFormatter.swift index a162d99..710a7b5 100644 --- a/Sources/mas/Formatters/AppInfoFormatter.swift +++ b/Sources/mas/Formatters/AppInfoFormatter.swift @@ -47,12 +47,8 @@ enum AppInfoFormatter { /// - Parameter serverDate: String containing a date in ISO-8601 format. /// - Returns: Simple date format. private static func humanReadableDate(_ serverDate: String) -> String { - let serverDateFormatter = DateFormatter() - serverDateFormatter.locale = Locale(identifier: "en_US_POSIX") - serverDateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" - - let humanDateFormatter = DateFormatter() - humanDateFormatter.dateFormat = "yyyy-MM-dd" - return serverDateFormatter.date(from: serverDate).flatMap(humanDateFormatter.string(from:)) ?? "" + let humanDateFormatter = ISO8601DateFormatter() + humanDateFormatter.formatOptions = [.withFullDate] + return ISO8601DateFormatter().date(from: serverDate).map(humanDateFormatter.string(from:)) ?? "" } }