Added the "isoDate" static property for the DateFormatter+Properties extension in the library target.
This commit is contained in:
@@ -18,17 +18,29 @@ extension DateFormatter {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
/// An ISO date formatter.
|
||||
///
|
||||
/// This formatter implements the `yyyy-MM-dd` date format.
|
||||
static let isoDate: DateFormatter = {
|
||||
let formatter = DateFormatter()
|
||||
|
||||
formatter.dateFormat = "yyyy-MM-dd"
|
||||
formatter.timeZone = .init(secondsFromGMT: 0)
|
||||
|
||||
return formatter
|
||||
}()
|
||||
|
||||
/// 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 {
|
||||
static let isoTimestamp: DateFormatter = {
|
||||
let formatter = DateFormatter()
|
||||
|
||||
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"
|
||||
formatter.timeZone = .init(secondsFromGMT: 0)
|
||||
|
||||
return formatter
|
||||
}
|
||||
}()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user