Hotfix date formats

This commit is contained in:
Garth Vander Houwen 2025-03-30 18:13:03 -07:00
parent ed9f0fde91
commit f1f0845aa2

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: .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