Explorar el Código

#223 Change type of lastModified to number

Ben Hsieh hace 8 años
padre
commit
5e0633d687
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 2
    2
      src/android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java
  2. 4
    1
      src/fs.js

+ 2
- 2
src/android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java Ver fichero

@@ -641,8 +641,8 @@ public class RNFetchBlobFS {
641 641
                 stat.putString("path", target.getPath());
642 642
                 stat.putString("type", target.isDirectory() ? "directory" : "file");
643 643
                 stat.putString("size", String.valueOf(target.length()));
644
-                int lastModified = (int) target.lastModified();
645
-                stat.putInt("lastModified", lastModified);
644
+                String lastModified = String.valueOf(target.lastModified());
645
+                stat.putString("lastModified", lastModified);
646 646
 
647 647
             }
648 648
             return stat;

+ 4
- 1
src/fs.js Ver fichero

@@ -201,8 +201,11 @@ function stat(path:string):Promise<RNFetchBlobFile> {
201 201
     RNFetchBlob.stat(path, (err, stat) => {
202 202
       if(err)
203 203
         reject(new Error(err))
204
-      else
204
+      else {
205
+        if(stat)
206
+          stat.lastModified = parseInt(stat.lastModified)
205 207
         resolve(stat)
208
+      }
206 209
     })
207 210
   })
208 211
 }