We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 828b4e6 commit 55dfab3Copy full SHA for 55dfab3
1 file changed
SmartCodable/Classes/PropertyWrapper/SmartDate.swift
@@ -90,17 +90,16 @@ struct DateParser {
90
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
91
]
92
93
+ // https://developer.apple.com/library/archive/qa/qa1480/_index.html
94
private static let locale = Locale(identifier: "en_US_POSIX")
95
96
static func parse(_ raw: Any) -> (Date, SmartDate.DateStrategy)? {
- // 优先尝试时间戳解析
97
if let result = parseTimestamp(from: raw) {
98
return result
99
}
100
101
- // 其次处理 String
102
if let string = raw as? String {
103
- // 尝试匹配 knownFormats
+ // try knownFormats
104
let formatter = DateFormatter()
105
formatter.locale = locale
106
for format in knownFormats {
0 commit comments