Explorar o código

fix formatter

Ivan Valkou %!s(int64=5) %!d(string=hai) anos
pai
achega
90ae34da2e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      FreeAPS/Sources/Helpers/JSON.swift

+ 1 - 1
FreeAPS/Sources/Helpers/JSON.swift

@@ -34,12 +34,12 @@ extension Bool: JSON {}
 extension Date: JSON {
 extension Date: JSON {
     var string: String {
     var string: String {
         let formatter = ISO8601DateFormatter()
         let formatter = ISO8601DateFormatter()
-        formatter.formatOptions = [.withColonSeparatorInTimeZone]
         return formatter.string(from: self)
         return formatter.string(from: self)
     }
     }
 
 
     init?(from: String) {
     init?(from: String) {
         let dateFormatter = ISO8601DateFormatter()
         let dateFormatter = ISO8601DateFormatter()
+        dateFormatter.formatOptions.insert(.withFractionalSeconds)
         let string = from.replacingOccurrences(of: "\"", with: "")
         let string = from.replacingOccurrences(of: "\"", with: "")
         if let date = dateFormatter.date(from: string) {
         if let date = dateFormatter.date(from: string) {
             self = date
             self = date