// // HistoryEntry.swift // oAI // // Command history entry model // // SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 // Copyright (C) 2026 Rune Olsen // // This file is part of oAI. // // oAI is licensed under the PolyForm Noncommercial License 1.0.0. // You may use, study, modify, and share it for any noncommercial // purpose. Commercial use — including selling oAI or any part of // it, standalone or bundled into another product or service — // requires a separate commercial license from the copyright holder. // // See the LICENSE file or // for // the full license text. For commercial licensing, contact Rune // Olsen via . import Foundation struct HistoryEntry: Identifiable, Equatable { let id = UUID() let input: String let timestamp: Date /// Format timestamp in European format (dd.MM.yyyy HH:mm:ss) var formattedDate: String { let formatter = DateFormatter() formatter.dateFormat = "dd.MM.yyyy HH:mm:ss" return formatter.string(from: timestamp) } /// Short date without time (dd.MM.yyyy) var shortDate: String { let formatter = DateFormatter() formatter.dateFormat = "dd.MM.yyyy" return formatter.string(from: timestamp) } /// Just the time (HH:mm:ss) var timeOnly: String { let formatter = DateFormatter() formatter.dateFormat = "HH:mm:ss" return formatter.string(from: timestamp) } }