Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration must be set with physical times error for aggregateGroupByPeriod on Anroid 13 and below #174

Open
Gytjarek opened this issue Oct 23, 2024 · 6 comments
Assignees

Comments

@Gytjarek
Copy link

When I call aggregateGroupByPeriod function on Android 13 and below, I do get the following error:
Duration must be set with physical times

const test = await aggregateGroupByPeriod({
    recordType: 'Steps',
    timeRangeFilter: {
        operator: 'between',
        startTime: new Date('2024-10-11').toISOString(),
        endTime: new Date('2024-10-15').toISOString(),
    },
    timeRangeSlicer: {
        period: 'DAYS',
        duration: 1,
    },
});

**Environment:**
 - Health Connect Version: 3.2.1
 - React Native Version: 0.73.6
 - Using Expo: Dev Client
 - Android API Level: API 33 (Android 13)
@matinzd
Copy link
Owner

matinzd commented Nov 19, 2024

This might be related to https://stackoverflow.com/a/74468785/7978635.

I might need to refactor the code to use LocalDateTime instead of Instant.

https://developer.android.com/health-and-fitness/guides/health-connect/develop/aggregate-data#duration

@matinzd matinzd self-assigned this Nov 19, 2024
@Gytjarek
Copy link
Author

Gytjarek commented Dec 2, 2024

@matinzd Hey! Could you let me know when you approximately plan to fix this bug and release an update?

@sjaakbanaan
Copy link

Hoping for a fix soon too!

@matinzd
Copy link
Owner

matinzd commented Dec 3, 2024

I can't promise until I find some free time. I am also working full-time and I am not paid to do work here.

@sjaakbanaan
Copy link

I can't promise until I find some free time. I am also working full-time and I am not paid to do work here.

Fully understandable, thanks for all the work so far!

@fitterup
Copy link

Hi Matin, we are willing to help (our devs) or fix the 'not paid'-part to fix this for the community. Just let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants