From 6e59b7d61dd780be94f0ce3ad73fe85e8d12cc29 Mon Sep 17 00:00:00 2001 From: Terrillo Walls Date: Sun, 3 Sep 2017 19:31:13 -0500 Subject: [PATCH] DistanceWalkingRunning docs update --- README.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7972a6f..fa4e17c 100644 --- a/README.md +++ b/README.md @@ -417,22 +417,28 @@ ___ Get the total distance walking/running on a specific day. `getDistanceWalkingRunning` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter`. + ```javascript let options = { - unit: 'mile', // optional; default 'meter' - date: (new Date(2016,5,1)).toISOString(), // optional; default now + unit: 'mile', // optional; default 'meter' + date: (new Date(2016,5,1)).toISOString(), // optional; default now }; -``` -```javascript AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Object) => { if(this._handleHKError(err, 'getDistanceWalkingRunning')){ return; } - // use res.value ... }); ``` +```javascript +{ + value: 200, + startDate: '2016-07-08T12:00:00.000-0400', + endDate: '2016-07-08T12:00:00.000-0400' +} +``` + ___ #### **`getDistanceCycling`** @@ -489,6 +495,7 @@ AppleHealthKit.initHealthKit(null: Object, (err: string, res: Object) => { let options = { unit: 'pound' }; + AppleHealthKit.getLatestWeight(options, (err: string, weight: Object) => { if (err) { console.log("error getting latest weight: ", err); -- 2.26.2