From 26cd0c6d129e7b048132adc52e8b37a7297df0f6 Mon Sep 17 00:00:00 2001 From: Terrillo Walls Date: Fri, 9 Nov 2018 17:46:15 -0600 Subject: [PATCH] Saving weight in the past --- RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m index 8fec38d..ca11ae2 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Body.m @@ -82,7 +82,7 @@ - (void)body_saveWeight:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback { double weight = [RCTAppleHealthKit doubleValueFromOptions:input]; - NSDate *sampleDate = [RCTAppleHealthKit dateFromOptionsDefaultNow:input]; + NSDate *sampleDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:[NSDate date]]; HKUnit *unit = [RCTAppleHealthKit hkUnitFromOptions:input key:@"unit" withDefault:[HKUnit poundUnit]]; HKQuantity *weightQuantity = [HKQuantity quantityWithUnit:unit doubleValue:weight]; diff --git a/README.md b/README.md index 94c88a1..d59e3df 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ AppleHealthKit.initHealthKit(options: Object, (err: string, results: Object) => ## Changelog 0.6.4v - Basal energy ([#23](https://github.com/terrillo/rn-apple-healthkit/pull/23)) +- Fixed issues with saving weight in the past 0.6.3v - Food and Water ([#19](https://github.com/terrillo/rn-apple-healthkit/pull/19)) -- 2.26.2