mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
fix(dawarich): a stay's length was sixty times too short
Dawarich's `duration` is minutes. It writes the column as `duration_minutes = ((ended_at - started_at) / 60).to_i` in `app/services/visits/create.rb` and serialises it straight through; the merge service rounds the same way. TREK read it as seconds and divided by sixty again, so an eighteen-minute stop reached the suggestion panel as "0 min" and an afternoon somewhere as "2 min". Found by connecting a real Dawarich 1.14.5 and comparing: a visit spanning 11:00:00 to 11:18:45 reports `duration: 18`. The span between the two timestamps is what the panel uses now. It agrees with the arrival and departure shown beside it and it survives whatever unit a future Dawarich picks; the reported figure only stands in when `ended_at` could not be parsed, and is read as minutes there too.
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user