mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-18 05:00:35 +00:00
20 lines
422 B
Swift
20 lines
422 B
Swift
import Foundation
|
|
import SwiftData
|
|
import SwiftUI
|
|
|
|
@Model public class RecentTag: Equatable {
|
|
public var title: String = ""
|
|
public var lastUse: Date = Date()
|
|
|
|
public init(title: String) {
|
|
self.title = title
|
|
self.lastUse = Date()
|
|
}
|
|
}
|
|
|
|
extension RecentTag {
|
|
public var formattedDate: String {
|
|
DateFormatterCache.shared.createdAtRelativeFormatter.localizedString(for: lastUse, relativeTo: Date())
|
|
}
|
|
}
|