Context
Two files create their own ISO8601DateFormatter instances and parseTimestamp functions:
ClaudeConversationIndex.swift (lines 76-86, 385-389)
- Two formatters: one with fractional seconds, one without
parseTimestamp returns Date? — tries fractional first, then plain, returns nil on failure
TranscriptParser.swift (lines 175-184)
- One formatter: fractional seconds only
parseTimestamp returns Date — falls back to Date() on failure (masks parse errors)
Differences
The two implementations have subtly different semantics:
ClaudeConversationIndex handles timestamps both with and without fractional seconds
TranscriptParser only handles fractional seconds — timestamps without them silently return Date() (current time)
Proposal
Create a shared DateParsing utility (or extend the existing ShellUtilities.swift) with:
enum DateParsing {
static func parseISO8601(_ value: String?) -> Date? { ... }
}
Both callers adopt the shared version, with TranscriptParser using ?? Date() at the call site if it needs that fallback.
🤖 Generated with Claude Code
Context
Two files create their own
ISO8601DateFormatterinstances andparseTimestampfunctions:ClaudeConversationIndex.swift(lines 76-86, 385-389)parseTimestampreturnsDate?— tries fractional first, then plain, returns nil on failureTranscriptParser.swift(lines 175-184)parseTimestampreturnsDate— falls back toDate()on failure (masks parse errors)Differences
The two implementations have subtly different semantics:
ClaudeConversationIndexhandles timestamps both with and without fractional secondsTranscriptParseronly handles fractional seconds — timestamps without them silently returnDate()(current time)Proposal
Create a shared
DateParsingutility (or extend the existingShellUtilities.swift) with:Both callers adopt the shared version, with
TranscriptParserusing?? Date()at the call site if it needs that fallback.🤖 Generated with Claude Code