import Foundation /// Parses the ISO-8601 timestamps Atomenta sends (`2026-04-16T12:00:00.000Z`, with /// milliseconds). `LCEssentials.API`'s internal `JSONDecoder` uses the default /// (`.deferredToDate`, numeric epoch) strategy, so `Date` fields on wire models /// decode the raw string manually instead of relying on `Decodable`'s default /// date handling. enum FeatureControlDateParsing { static func parse(_ string: String) -> Date? { let withFractional = ISO8601DateFormatter() withFractional.formatOptions = [.withInternetDateTime, .withFractionalSeconds] if let date = withFractional.date(from: string) { return date } let plain = ISO8601DateFormatter() plain.formatOptions = [.withInternetDateTime] return plain.date(from: string) } }