diff options
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js')
| -rw-r--r--[-rwxr-xr-x] | StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js b/StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js index 3814919a..f1f64456 100755..100644 --- a/StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js +++ b/StoneIsland/plugins/cordova-plugin-geolocation/www/geolocation.js @@ -102,7 +102,7 @@ var geolocation = { velocity:p.velocity, altitudeAccuracy:p.altitudeAccuracy }, - (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) + p.timestamp ); geolocation.lastPosition = pos; successCallback(pos); @@ -118,7 +118,7 @@ var geolocation = { // Check our cached position, if its timestamp difference with current time is less than the maximumAge, then just // fire the success callback with the cached position. - if (geolocation.lastPosition && options.maximumAge && (((new Date()).getTime() - geolocation.lastPosition.timestamp.getTime()) <= options.maximumAge)) { + if (geolocation.lastPosition && options.maximumAge && (((new Date()).getTime() - geolocation.lastPosition.timestamp) <= options.maximumAge)) { successCallback(geolocation.lastPosition); // If the cached position check failed and the timeout was set to 0, error out with a TIMEOUT error object. } else if (options.timeout === 0) { @@ -184,7 +184,7 @@ var geolocation = { velocity:p.velocity, altitudeAccuracy:p.altitudeAccuracy }, - (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) + p.timestamp ); geolocation.lastPosition = pos; successCallback(pos); |
