From 5cd8d586c64009b2c3d5d4ef269143cf0c92ac3b Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 18 Sep 2026 23:59:29 +0200 Subject: [PATCH] Add build date to the About settings view --- Yattee/Localizable.xcstrings | 10 ++++++++++ Yattee/Views/Settings/AboutView.swift | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/Yattee/Localizable.xcstrings b/Yattee/Localizable.xcstrings index d2d5e001..7549973a 100644 --- a/Yattee/Localizable.xcstrings +++ b/Yattee/Localizable.xcstrings @@ -10053,6 +10053,16 @@ } } }, + "settings.advanced.debug.buildDate" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Build Date" + } + } + } + }, "settings.advanced.debug.buildNumber" : { "localizations" : { "en" : { diff --git a/Yattee/Views/Settings/AboutView.swift b/Yattee/Views/Settings/AboutView.swift index 3f800c6f..1f11bffd 100644 --- a/Yattee/Views/Settings/AboutView.swift +++ b/Yattee/Views/Settings/AboutView.swift @@ -108,6 +108,7 @@ struct AboutView: View { SettingsFormSection("settings.about.versionInfo") { versionInfoRow(label: String(localized: "settings.advanced.debug.appVersion"), value: appVersion) versionInfoRow(label: String(localized: "settings.advanced.debug.buildNumber"), value: buildNumber) + versionInfoRow(label: String(localized: "settings.advanced.debug.buildDate"), value: buildDate) versionInfoRow(label: String(localized: "settings.advanced.debug.osVersion"), value: osVersion) } } @@ -207,6 +208,13 @@ struct AboutView: View { Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "Unknown" } + private var buildDate: String { + guard let executableURL = Bundle.main.executableURL, + let date = (try? executableURL.resourceValues(forKeys: [.contentModificationDateKey]))?.contentModificationDate + else { return "Unknown" } + return date.formatted(date: .abbreviated, time: .shortened) + } + private var osVersion: String { #if os(iOS) return "iOS \(UIDevice.current.systemVersion)"