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

Commit 5c20ca6

Browse files
committed
Fix #227 lastModifed date value and format
1 parent 132bdc7 commit 5c20ca6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static WritableMap statFile(String path) {
630630
stat.putString("path", path);
631631
stat.putString("type", "asset");
632632
stat.putString("size", String.valueOf(fd.getLength()));
633-
stat.putString("lastModified", "0");
633+
stat.putInt("lastModified", 0);
634634
}
635635
else {
636636
File target = new File(path);
@@ -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-
String lastModified = String.valueOf(target.lastModified());
645-
stat.putString("lastModified", lastModified);
644+
int lastModified = (int) target.lastModified();
645+
stat.putInt("lastModified", lastModified);
646646

647647
}
648648
return stat;

src/ios/RNFetchBlobFS.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ + (NSDictionary *) stat:(NSString *) path error:(NSError **) error {
494494
@"size" : size,
495495
@"filename" : filename,
496496
@"path" : path,
497-
@"lastModified" : [NSString stringWithFormat:@"%d", [lastModified timeIntervalSince1970]],
497+
@"lastModified" : [NSNumber numberWithLong:(time_t) [lastModified timeIntervalSince1970]*1000],
498498
@"type" : isDir ? @"directory" : @"file"
499499
};
500500

0 commit comments

Comments
 (0)