feat(time): add H:MM duration display format option (PMS-265) #120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/pms-265-duration-format-option"
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?
What
Adds H:MM as an additional logged-time display format (90 min ->
1:30, 30 min ->0:30), selectable per-device on Profile > Preferences. Decimal (1.5h) stays the default, so existing users see no change until they opt in. Closes PMS-265.Why
Time entries are stored as whole
duration_minutesbut the SPA only ever rendered them as decimal hours. Many users read timesheets faster in clock style. This adds the option without removing the decimal shape.How
src/utils/duration.rscentral formatter:fmt_hm,fmt_decimal, andfmt_duration(reads themokosh_duration_formatlocalStorage pref, defaultdecimal, on each call so a change applies on the next render). Owns the pref key + default.utils::prefs::set_str.fmt_duration: Time Entries stat cards + Hours cells, Timesheets weekly grid (cells, row totals, daily totals, grand total), and the Dashboard recent-time table.Testing
cargo test --lib: 74 pass (6 new for the formatter: zero, sub-hour padding, exact hours, mixed, negative clamp, decimal shape).cargo check --target wasm32-unknown-unknown: clean.cargo clippy --all-targets: clean except the pre-existingmanual_checked_opswarning atprojects.rs:930, which is a rust-1.95-only lint not present in CI's rust-1.94 image and unrelated to this change.Relates to PMS-233.
🤖 Generated with Claude Code