Hotfix workout time backfill and edit timezone parsing#45
Merged
brianwalborn merged 1 commit intomainfrom Mar 25, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 addresses and corrects the logic for handling workout start and end times throughout the backend and frontend, ensuring consistency in how these times are calculated, stored, and displayed. The main focus is on fixing previous errors in time backfilling during migrations, improving workout creation and update logic, and ensuring date parsing is robust on the frontend.
Backend data correction and logic fixes:
Database migration fix for workout times:
Added a new Alembic migration (
2b3c4d5e6f7a_fix_workout_time_backfill.py) to correct previously backfilledstart_timeandend_timevalues in theworkoutstable. This migration ensures thatstart_timeis set todate - durationandend_timeis set todate, fixing earlier logic that had these reversed.Fix workout creation and update logic:
Updated
create_workoutandupdate_workoutinbackend/app/crud/workouts.pyto consistently treatdateas the workout end time, and to always computestart_timeasend_time - durationwhen not explicitly provided. Also, thedatefield is now set to matchend_timefor new and updated workouts. [1] [2]Corrected original migration logic:
Modified the original migration (
1a2b3c4d5e6f_add_start_end_times_to_workouts.py) so thatstart_timeis calculated asend_time - durationandend_timeis set to the value ofdate, aligning with the corrected definition.Frontend date handling improvements:
Introduced the
parseWorkoutDateTimeutility inProgressView.vueto properly handle ISO date strings (with or without timezone info), preventing timezone-related bugs when displaying or editing workout times. Updated all relevant usages to utilize this function. [1] [2]