Commit ad2e4eac authored by Furyou81's avatar Furyou81

adding period for all

parent ae8f24d9
...@@ -220,6 +220,7 @@ ...@@ -220,6 +220,7 @@
BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false];
NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil];
NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]];
NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60];
if(startDate == nil){ if(startDate == nil){
callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]);
return; return;
...@@ -229,6 +230,7 @@ ...@@ -229,6 +230,7 @@
[self fetchCumulativeSumStatisticsCollection:quantityType [self fetchCumulativeSumStatisticsCollection:quantityType
unit:unit unit:unit
period:period
startDate:startDate startDate:startDate
endDate:endDate endDate:endDate
ascending:ascending ascending:ascending
...@@ -250,6 +252,7 @@ ...@@ -250,6 +252,7 @@
BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false];
NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil];
NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]];
NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60];
if(startDate == nil){ if(startDate == nil){
callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]);
return; return;
...@@ -259,6 +262,7 @@ ...@@ -259,6 +262,7 @@
[self fetchCumulativeSumStatisticsCollection:quantityType [self fetchCumulativeSumStatisticsCollection:quantityType
unit:unit unit:unit
period:period
startDate:startDate startDate:startDate
endDate:endDate endDate:endDate
ascending:ascending ascending:ascending
...@@ -304,6 +308,7 @@ ...@@ -304,6 +308,7 @@
BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false];
NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil];
NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]];
NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60];
if(startDate == nil){ if(startDate == nil){
callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]);
return; return;
...@@ -313,6 +318,7 @@ ...@@ -313,6 +318,7 @@
[self fetchCumulativeSumStatisticsCollection:quantityType [self fetchCumulativeSumStatisticsCollection:quantityType
unit:unit unit:unit
period:period
startDate:startDate startDate:startDate
endDate:endDate endDate:endDate
ascending:ascending ascending:ascending
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment