Meshtastic-Apple/MeshtasticClient/Views/Helpers/LastHeardText.swift
Garth Vander Houwen 233fb0a1e0 Display time only from mesh, remove all times set in the iOS app.
Add Bitrate
Format assorted things.
Fix battery display on node details
make node list more friendly on iPad and mac
2022-05-25 22:30:48 -07:00

22 lines
456 B
Swift

import SwiftUI
//
// LastHeardText.swift
// Meshtastic Apple
//
// Created by Garth Vander Houwen on 5/25/22.
//
struct LastHeardText: View {
var lastHeard: Date?
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
var body: some View {
if (lastHeard != nil && lastHeard! >= sixMonthsAgo!){
Text("Last Heard: \(lastHeard!, style: .relative) ago")
} else {
Text("Last Heard: Unknown Age")
}
}
}