mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Hotfix date formats
This commit is contained in:
parent
ed9f0fde91
commit
f1f0845aa2
1 changed files with 2 additions and 2 deletions
|
|
@ -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: .year, value: 5, 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue