File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/amplify_storage_s3/ios/Classes Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public class AmplifyStorageOperations {
98
98
switch event{
99
99
case . success( let result) :
100
100
var listResultDictionary = [ String: Any] ( ) ;
101
- var storageItemList = [ [ String: Any] ] ( ) ;
101
+ var storageItemList = [ [ String: Any? ] ] ( ) ;
102
102
for item in result. items {
103
103
let storageItemDictionary = getStorageItemDictionary ( item: item)
104
104
storageItemList. append ( storageItemDictionary)
@@ -140,11 +140,15 @@ public class AmplifyStorageOperations {
140
140
}
141
141
}
142
142
143
- private static func getStorageItemDictionary( item: StorageListResult . Item ) -> Dictionary < String , Any > {
144
- let itemAsDictionary : [ String : Any ] = [
143
+ private static func getStorageItemDictionary( item: StorageListResult . Item ) -> Dictionary < String , Any ? > {
144
+ var lastModifiedStr : String ? = nil
145
+ if let lastModified = item. lastModified {
146
+ lastModifiedStr = Temporal . DateTime ( lastModified) . iso8601String
147
+ }
148
+ let itemAsDictionary : [ String : Any ? ] = [
145
149
" key " : item. key,
146
150
" eTag " : item. eTag as Any ,
147
- " lastModified " : item . lastModified ? . description as Any ,
151
+ " lastModified " : lastModifiedStr ,
148
152
" size " : item. size as Any
149
153
]
150
154
return itemAsDictionary
You can’t perform that action at this time.
0 commit comments