Browse Source

#223 Change type of lastModified to number

Ben Hsieh 8 years ago
parent
commit
5e0633d687
2 changed files with 6 additions and 3 deletions
  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 View File

641
                 stat.putString("path", target.getPath());
641
                 stat.putString("path", target.getPath());
642
                 stat.putString("type", target.isDirectory() ? "directory" : "file");
642
                 stat.putString("type", target.isDirectory() ? "directory" : "file");
643
                 stat.putString("size", String.valueOf(target.length()));
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
             return stat;
648
             return stat;

+ 4
- 1
src/fs.js View File

201
     RNFetchBlob.stat(path, (err, stat) => {
201
     RNFetchBlob.stat(path, (err, stat) => {
202
       if(err)
202
       if(err)
203
         reject(new Error(err))
203
         reject(new Error(err))
204
-      else
204
+      else {
205
+        if(stat)
206
+          stat.lastModified = parseInt(stat.lastModified)
205
         resolve(stat)
207
         resolve(stat)
208
+      }
206
     })
209
     })
207
   })
210
   })
208
 }
211
 }