Add build date to the About settings view

This commit is contained in:
Arkadiusz Fal
2026-09-18 23:59:29 +02:00
parent d22abf6088
commit 5cd8d586c6
2 changed files with 18 additions and 0 deletions

View File

@@ -10053,6 +10053,16 @@
}
}
},
"settings.advanced.debug.buildDate" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Build Date"
}
}
}
},
"settings.advanced.debug.buildNumber" : {
"localizations" : {
"en" : {

View File

@@ -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)"