diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.h b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.h index 05dbddc8ee51dfcc082a7a1209540e5d52940a5a..e01ee81b1b944ea25da7a618e6b9113dd3f4e44b 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.h +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.h @@ -33,8 +33,7 @@ completion:(void (^)(NSArray *, NSError *))completion; - (void)fetchCumulativeSumStatisticsCollection:(HKQuantityType *)quantityType unit:(HKUnit *)unit - period:(NSUInteger)period - startDate:(NSDate *)startDate + startDate:(NSDate *)startDate endDate:(NSDate *)endDate ascending:(BOOL)asc limit:(NSUInteger)lim diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m index 040e7bba492c3547bc2114cbb99fb22a367c2c4b..f63cbb7371f1dd503ef293e4993057eeef9cdb84 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m @@ -467,7 +467,7 @@ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"metadata.%K != YES", interval.minute = period; NSDateComponents *anchorComponents = [calendar components:NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond | NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear - fromDate:[NSDate date]]; + fromDate:startDate]; //anchorComponents.hour = 0; NSDate *anchorDate = [calendar dateFromComponents:anchorComponents]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"metadata.%K != YES", HKMetadataKeyWasUserEntered];