react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Fix Location Callback Schema example
Change timestamp from Date
to ISO-8601 UTC
string.
https://github.com/transistorsoft/react-native-background-geolocation/blob/7745a0c417d50780845d74f83ae085aa9bbe3163/src/declarations/interfaces/Location.d.ts#L130-L133
The interface Location
specifies that timestamp
property is of type string
and is in fact provided an ISO 8601 string in the onLocation
listener callback.
@christocracy I am also getting string instead of js date from onLocation callback
I just came here to open this same PR. If there are two different formats returned by different things maybe this should list both and link them correctly?
I'm using this from BackgroundGeolocation.getCurrentPosition
fyi, I'm getting an ISO-8601 string for timestamp:
"2021-07-22T22:12:02.393Z"
It will remain String.
Create your own new Date(timestamp)
instance.
The docs will be updated.