mirror of
https://github.com/yattee/yattee.git
synced 2026-11-05 03:17:19 +00:00
Add build date to the About settings view
This commit is contained in:
@@ -10053,6 +10053,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"settings.advanced.debug.buildDate" : {
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "Build Date"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"settings.advanced.debug.buildNumber" : {
|
"settings.advanced.debug.buildNumber" : {
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ struct AboutView: View {
|
|||||||
SettingsFormSection("settings.about.versionInfo") {
|
SettingsFormSection("settings.about.versionInfo") {
|
||||||
versionInfoRow(label: String(localized: "settings.advanced.debug.appVersion"), value: appVersion)
|
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.buildNumber"), value: buildNumber)
|
||||||
|
versionInfoRow(label: String(localized: "settings.advanced.debug.buildDate"), value: buildDate)
|
||||||
versionInfoRow(label: String(localized: "settings.advanced.debug.osVersion"), value: osVersion)
|
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"
|
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 {
|
private var osVersion: String {
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
return "iOS \(UIDevice.current.systemVersion)"
|
return "iOS \(UIDevice.current.systemVersion)"
|
||||||
|
|||||||
Reference in New Issue
Block a user