diff --git a/Sources/Internal/Extensions/DateFormatter+Properties.swift b/Sources/Internal/Extensions/DateFormatter+Properties.swift index 5a8e372..69818bf 100644 --- a/Sources/Internal/Extensions/DateFormatter+Properties.swift +++ b/Sources/Internal/Extensions/DateFormatter+Properties.swift @@ -14,7 +14,13 @@ import Foundation extension DateFormatter { - static var isoDateTime: DateFormatter { + // MARK: Properties + + /// An ISO timestamp formatter. + /// + /// This formatter implements the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` custom date format. + /// Within the context of this library, this formatter is solely used to decode a date formatted as a timestamp that is returned by the ``AmiiboService/getLastUpdated()`` function. + static var isoTimestamp: DateFormatter { let formatter = DateFormatter() formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS" diff --git a/Sources/Internal/Transcoders/ISODateTranscoder.swift b/Sources/Internal/Transcoders/ISOTimestampTranscoder.swift similarity index 70% rename from Sources/Internal/Transcoders/ISODateTranscoder.swift rename to Sources/Internal/Transcoders/ISOTimestampTranscoder.swift index 6b81d5b..887cd63 100644 --- a/Sources/Internal/Transcoders/ISODateTranscoder.swift +++ b/Sources/Internal/Transcoders/ISOTimestampTranscoder.swift @@ -13,10 +13,18 @@ import Foundation import OpenAPIRuntime -struct ISODateTranscoder: DateTranscoder { - +/// A type that allows the decoding and encoding of ISO timestamp dates, defined by the `yyyy-MM-dd'T'HH:mm:ss.SSSSSS` custom date format. +struct ISOTimestampTranscoder { + // MARK: Properties - private let dateFormatter: DateFormatter = .isoDateTime + + private let dateFormatter: DateFormatter = .isoTimestamp + +} + + // MARK: - DateTranscoder + +extension ISOTimestampTranscoder: DateTranscoder { // MARK: Functions