Updated Branches: refs/heads/master 29e353bf8 -> 109b8649b
Fixes CB-866 - Position.timestamp as Date Update code to set Posistion.timestamp as a Date object. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/109b8649 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/109b8649 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/109b8649 Branch: refs/heads/master Commit: 109b8649b0e98597b147842a6f71999d2f7910f2 Parents: 29e353b Author: Becky Gibson <becka...@apache.org> Authored: Tue Jun 5 14:11:07 2012 -0400 Committer: Becky Gibson <becka...@apache.org> Committed: Tue Jun 5 15:02:06 2012 -0400 ---------------------------------------------------------------------- lib/common/plugin/Position.js | 2 +- lib/common/plugin/geolocation.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/109b8649/lib/common/plugin/Position.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/Position.js b/lib/common/plugin/Position.js index deb7c49..3e150b6 100644 --- a/lib/common/plugin/Position.js +++ b/lib/common/plugin/Position.js @@ -6,7 +6,7 @@ var Position = function(coords, timestamp) { } else { this.coords = new Coordinates(); } - this.timestamp = (timestamp !== undefined) ? timestamp : new Date().getTime(); + this.timestamp = (timestamp !== undefined) ? timestamp : new Date(); }; module.exports = Position; http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/109b8649/lib/common/plugin/geolocation.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/geolocation.js b/lib/common/plugin/geolocation.js index eef4382..cab311c 100644 --- a/lib/common/plugin/geolocation.js +++ b/lib/common/plugin/geolocation.js @@ -82,7 +82,7 @@ var geolocation = { velocity:p.velocity, altitudeAccuracy:p.altitudeAccuracy }, - p.timestamp || new Date() + (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) ); geolocation.lastPosition = pos; successCallback(pos); @@ -166,7 +166,7 @@ var geolocation = { velocity:p.velocity, altitudeAccuracy:p.altitudeAccuracy }, - p.timestamp || new Date() + (p.timestamp === undefined ? new Date() : ((p.timestamp instanceof Date) ? p.timestamp : new Date(p.timestamp))) ); geolocation.lastPosition = pos; successCallback(pos);