Merge pull request #1160 from meshtastic/2.5.22

2.5.21 Date hot fixes and community support badge
This commit is contained in:
Garth Vander Houwen 2025-03-30 18:14:15 -07:00 committed by GitHub
commit 37f31e714d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View file

@ -4251,6 +4251,9 @@
}
}
}
},
"Community Support" : {
},
"Config" : {
"localizations" : {
@ -10673,6 +10676,9 @@
}
}
}
},
"Full Support" : {
},
"gas" : {
"extractionState" : "manual",

View file

@ -10,7 +10,7 @@ import Foundation
extension Date {
var lastHeard: String {
if self.timeIntervalSince1970 > 0 && self < Calendar.current.date(byAdding: .day, value: 1, to: Date())! {
if self.timeIntervalSince1970 > 0 && self < Calendar.current.date(byAdding: .year, value: 1, to: Date())! {
formatted()
} else {
"unknown.age".localized
@ -20,7 +20,7 @@ extension Date {
func formattedDate(format: String) -> String {
let dateformat = DateFormatter()
dateformat.dateFormat = format
if self.timeIntervalSince1970 > 0 && self < Calendar.current.date(byAdding: .day, value: 1, to: Date())! {
if self.timeIntervalSince1970 > 0 && self < Calendar.current.date(byAdding: .year, value: 1, to: Date())! {
return dateformat.string(from: self)
} else {
return "unknown.age".localized

View file

@ -22,12 +22,12 @@ struct NodeInfoItem: View {
if user.hwModel != "UNSET" {
VStack(alignment: .center) {
Spacer()
Image(systemName: currentDevice?.activelySupported ?? false ? "checkmark.seal.fill" : "x.circle")
Image(systemName: currentDevice?.activelySupported ?? false ? "checkmark.seal.fill" : "seal.fill")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 75, height: 75)
.foregroundStyle(currentDevice?.activelySupported ?? false ? .green : .red)
Text( currentDevice?.activelySupported ?? false ? "Supported" : "Unsupported")
Text( currentDevice?.activelySupported ?? false ? "Full Support" : "Community Support")
.foregroundStyle(.gray)
.font(.callout)
}