Expect lastPosition to have a timestamp that is already in msecs (DOMTimeStamp)
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/bf8a3734 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/bf8a3734 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/bf8a3734 Branch: refs/heads/master Commit: bf8a373418f3056da93c85f957d91197f51db18a Parents: 163051a Author: Jesse MacFadyen <[email protected]> Authored: Tue Oct 27 17:28:50 2015 -0700 Committer: Jesse MacFadyen <[email protected]> Committed: Tue Oct 27 17:28:50 2015 -0700 ---------------------------------------------------------------------- www/geolocation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/bf8a3734/www/geolocation.js ---------------------------------------------------------------------- diff --git a/www/geolocation.js b/www/geolocation.js index 6873ce9..f1f6445 100644 --- a/www/geolocation.js +++ b/www/geolocation.js @@ -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) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
