import garmin data in date range #154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant changes to the Garmin integration, transitioning from "days-based" to "date-range-based" functionality for activity and health data retrieval. It includes backend updates to support date ranges, frontend modifications for user input, and improved error handling and logging.
Backend Changes
Refactored Functions to Support Date Ranges:
fetch_and_process_activities_by_dates
andfetch_and_process_bc_by_dates
: Updated to acceptstart_date
andend_date
parameters instead of calculating based on days. These functions now fetch data within a specific date range, improving flexibility. [1] [2]get_user_garminconnect_activities_by_dates
andget_user_garminconnect_bc_by_dates
: Replaced the previous "days-based" functions to handle date ranges. Added detailed logging for the date range being processed. [1] [2]Enhanced Error Handling and Logging:
Frontend Changes
New Date Range Modal Component:
ModalComponentDateRangeInput.vue
: A reusable modal for selecting start and end dates, with default values pre-set to the last 7 days. This component emits the selected date range for further processing.Updated UI for Garmin Data Retrieval:
SettingsIntegrationsZone.vue
to replace "days-based" options with "date-range-based" options for both activity and health data retrieval.API Changes
/activities
and/health
endpoints to acceptstart_date
andend_date
parameters instead ofdays
. Adjusted background tasks to use the new date range methods. [1] [2]