Timezone-aware completion timestamps and location-based time handling #183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — discovered during daily use. Completion times need to reflect the crew's actual location, not a hardcoded server timezone.
Repo
ldraney/landscaping-assistantUser Story
As a crew member
I want to see what time I finished each property in my local timezone
So that I can track my pace and review my day accurately
Context
The app hardcodes
config.time_zone = "Mountain Time (US & Canada)"and has no concept of per-property or per-user timezone. When a work queue item is checked off, no timestamp is recorded — just a boolean toggle. The crew operates from their phones at property locations, so the browser knows the correct timezone viaIntl.DateTimeFormat. Properties already have lat/lng but the GPS detection JS never sends them to the server, and no timezone is derived from location.File Targets
Files to modify:
app/controllers/application_controller.rb-- browser timezone cookie → Time.zone per requestapp/controllers/work_queue_items_controller.rb-- use toggle_completion! to set completed_atapp/controllers/properties_controller.rb-- permit time_zone paramapp/models/property.rb-- local_time_zone helperapp/models/work_queue_item.rb-- toggle_completion!, finished_at_localapp/views/work_queue_items/_queue_item.html.erb-- show "Finished at" timeapp/views/layouts/application.html.erb-- browser_tz cookie scriptapp/javascript/controllers/add_location_controller.js-- send lat/lng + timezonebin/dev-- fix to use docker composedb/migrate/-- new migration for completed_at and time_zone columnsFeature Flag
none — this is a core data model improvement, not a toggleable workflow.
Acceptance Criteria
Test Expectations
bundle exec rspec spec/models/work_queue_item_spec.rb spec/requests/work_queue_items_spec.rbConstraints
Checklist
Related
landscaping-assistant-- project this affects