Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 5e0633d

Browse files
committed
#223 Change type of lastModified to number
1 parent d498a50 commit 5e0633d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ static WritableMap statFile(String path) {
641641
stat.putString("path", target.getPath());
642642
stat.putString("type", target.isDirectory() ? "directory" : "file");
643643
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);
646646

647647
}
648648
return stat;

src/fs.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ function stat(path:string):Promise<RNFetchBlobFile> {
201201
RNFetchBlob.stat(path, (err, stat) => {
202202
if(err)
203203
reject(new Error(err))
204-
else
204+
else {
205+
if(stat)
206+
stat.lastModified = parseInt(stat.lastModified)
205207
resolve(stat)
208+
}
206209
})
207210
})
208211
}

0 commit comments

Comments
 (0)