marinofaggiana 5 年之前
父节点
当前提交
db42415826
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      iOSClient/Networking/NCCommunication.swift

+ 9 - 0
iOSClient/Networking/NCCommunication.swift

@@ -96,6 +96,15 @@ class NCCommunication: NSObject {
                             file.path = href.removingPercentEncoding ?? ""
                         }
                         let propstat = element["d:propstat"][0]
+                        
+                        if let getlastmodified = propstat["d:prop", "d:getlastmodified"].text {
+                            let dateFormatter = DateFormatter()
+                            dateFormatter.locale = Locale.init(identifier: "en_US_POSIX")
+                            dateFormatter.dateFormat = "EEE, dd MMM y HH:mm:ss zzz"
+                            if let date = dateFormatter.date(from: getlastmodified) {
+                                file.date = date as NSDate
+                            }
+                        }
                         if let getetag = propstat["d:prop", "d:getetag"].text {
                             file.etag = getetag.replacingOccurrences(of: "\"", with: "")
                         }