Documented the ISOTimestampTranscoder transcoder in the library target.

This commit is contained in:
2025-09-09 07:23:55 +02:00
parent 06ea92b72e
commit 21fba2612d
2 changed files with 18 additions and 4 deletions
@@ -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"
@@ -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