handle safari cocoa core data timestamps (#8440)
This commit is contained in:
parent
c4e988f406
commit
de7d5e7c7e
1 changed files with 6 additions and 1 deletions
|
@ -86,8 +86,13 @@ export const genericPositionFromGeolocation = (geoPosition: GeolocationPosition)
|
|||
const {
|
||||
latitude, longitude, altitude, accuracy,
|
||||
} = geoPosition.coords;
|
||||
|
||||
return {
|
||||
timestamp: geoPosition.timestamp,
|
||||
// safari reports geolocation timestamps as Apple Cocoa Core Data timestamp
|
||||
// or ms since 1/1/2001 instead of the regular epoch
|
||||
// they also use local time, not utc
|
||||
// to simplify, just use Date.now()
|
||||
timestamp: Date.now(),
|
||||
latitude, longitude, altitude, accuracy,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue