Documented the ISOTimestampTranscoder transcoder in the library target.
This commit is contained in:
@@ -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"
|
||||
|
||||
+11
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user