react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Fix Location Callback Schema example

Open wuppious opened this issue 4 years ago • 5 comments

Change timestamp from Date to ISO-8601 UTC string.

wuppious avatar Mar 06 '20 15:03 wuppious

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.

wuppious avatar Mar 07 '20 21:03 wuppious

@christocracy I am also getting string instead of js date from onLocation callback

woodybury avatar May 24 '21 17:05 woodybury

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?

chrisdrackett avatar Jul 22 '21 21:07 chrisdrackett

I'm using this from BackgroundGeolocation.getCurrentPosition fyi, I'm getting an ISO-8601 string for timestamp:

"2021-07-22T22:12:02.393Z"

chrisdrackett avatar Jul 22 '21 22:07 chrisdrackett

It will remain String.

Create your own new Date(timestamp) instance.

The docs will be updated.

christocracy avatar Jul 22 '21 22:07 christocracy