mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +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" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user