mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Fix a bug in the file-system module for iOS (NSDate is automatically marshalled to JS Date).
This commit is contained in:
@ -18,11 +18,7 @@ export class FileSystemAccess {
|
||||
var attributes = fileManager.attributesOfItemAtPathError(path, null);
|
||||
|
||||
if (attributes) {
|
||||
var date = attributes.objectForKey(this.keyModificationTime);
|
||||
var interval = date.timeIntervalSince1970();
|
||||
|
||||
// time interval is in seconds, Date constructor expects milliseconds, hence this multiply by 1000
|
||||
return new Date(interval * 1000);
|
||||
return attributes.objectForKey(this.keyModificationTime);
|
||||
} else {
|
||||
return new Date();
|
||||
}
|
||||
|
@ -159,7 +159,8 @@ export class File extends FileSystemEntity {
|
||||
}
|
||||
|
||||
get isLocked(): boolean {
|
||||
return this[fileLockedProperty];
|
||||
// !! is a boolean conversion/cast, handling undefined as well
|
||||
return !!this[fileLockedProperty];
|
||||
}
|
||||
|
||||
public readText(encoding?: string): Promise<string> {
|
||||
|
Reference in New Issue
Block a user