forked from loafle/openapi-generator-original
* fix #2159 dataformatter error for iOS Swift When trying to parse 24-hour time to 12-hour time, date formatter throws fatal error. It's caused by lack of settings locale for date formatter. * update sample code
This commit is contained in:
parent
21657f80cf
commit
c1a9b7313e
@ -121,6 +121,7 @@ class Decoders {
|
||||
"yyyy-MM-dd'T'HH:mm:ss.SSS"
|
||||
].map { (format: String) -> NSDateFormatter in
|
||||
let formatter = NSDateFormatter()
|
||||
formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX")
|
||||
formatter.dateFormat = format
|
||||
return formatter
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ class Decoders {
|
||||
"yyyy-MM-dd'T'HH:mm:ss.SSS"
|
||||
].map { (format: String) -> NSDateFormatter in
|
||||
let formatter = NSDateFormatter()
|
||||
formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX")
|
||||
formatter.dateFormat = format
|
||||
return formatter
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ class Decoders {
|
||||
"yyyy-MM-dd'T'HH:mm:ss.SSS"
|
||||
].map { (format: String) -> NSDateFormatter in
|
||||
let formatter = NSDateFormatter()
|
||||
formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX")
|
||||
formatter.dateFormat = format
|
||||
return formatter
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ class Decoders {
|
||||
"yyyy-MM-dd'T'HH:mm:ss.SSS"
|
||||
].map { (format: String) -> NSDateFormatter in
|
||||
let formatter = NSDateFormatter()
|
||||
formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX")
|
||||
formatter.dateFormat = format
|
||||
return formatter
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user