mirror of https://github.com/vector-im/riot-web
handle safari cocoa core data timestamps (#8440)
parent
c4e988f406
commit
de7d5e7c7e
|
@ -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…
Reference in New Issue