fix: set header date formatter options
This commit is contained in:
parent
27a7ccbd88
commit
00fb8eb175
|
@ -91,9 +91,3 @@ extension Mastodon.API.Timeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension Bool {
|
||||
var queryItemValue: String {
|
||||
return self ? "true" : "false"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,11 @@ import enum NIOHTTP1.HTTPResponseStatus
|
|||
extension Mastodon.API {
|
||||
|
||||
static let timeoutInterval: TimeInterval = 10
|
||||
static let httpHeaderDateFormatter = ISO8601DateFormatter()
|
||||
static let httpHeaderDateFormatter: ISO8601DateFormatter = {
|
||||
var formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions.insert(.withFractionalSeconds)
|
||||
return formatter
|
||||
}()
|
||||
static let encoder: JSONEncoder = {
|
||||
let encoder = JSONEncoder()
|
||||
encoder.dateEncodingStrategy = .iso8601
|
||||
|
|
|
@ -18,7 +18,7 @@ extension Mastodon.Entity {
|
|||
public let content: String
|
||||
public let account: User
|
||||
|
||||
public let language: String
|
||||
public let language: String?
|
||||
public let visibility: String
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
//
|
||||
// Bool.swift
|
||||
//
|
||||
//
|
||||
// Created by MainasuK Cirno on 2021/1/27.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Bool {
|
||||
var queryItemValue: String {
|
||||
return self ? "true" : "false"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue