fix: Allow any minute value (0-59) in time entry modal#181
Conversation
Previously minutes were restricted to 15-minute increments (step=15, max=45). Now users can enter any minute value from 0-59, enabling precise time logging like 1h 45m. Closes #177 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the timesheet time-entry modal to support precise minute entry (0–59) instead of fixed 15-minute increments, improving accuracy when logging/editing durations.
Changes:
- Removes the 15-minute stepping restriction for the Minutes field.
- Increases the Minutes max from 45 to 59.
- Adjusts edit-mode prefill to show empty inputs when hours/minutes are zero, and inlines the “hours >= 24 => minutes = 0” behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const h = Math.floor(entry.hours); | ||
| const m = Math.round((entry.hours - h) * 60); |
There was a problem hiding this comment.
Fixed in 8c039d8. Now using totalMinutes = Math.round(entry.hours * 60) then deriving h = Math.floor(totalMinutes / 60) and m = totalMinutes % 60 to avoid the rounding-to-60 edge case.
| label="Minutes" | ||
| type="number" | ||
| min="0" | ||
| max="45" | ||
| step="15" | ||
| max="59" | ||
| value={minutes} | ||
| onChange={(e) => setMinutes(e.target.value)} | ||
| placeholder="0" |
There was a problem hiding this comment.
Fixed in 8c039d8. Both onChange handlers now clamp values to valid ranges (hours 0-24, minutes 0-59). The submit handler also clamps before computing totalHours as a safety net.
- Use totalMinutes approach to avoid Math.round rounding to 60 minutes - Clamp hours (0-24) and minutes (0-59) in onChange handlers - Validate/clamp values in handleSubmit before computing totalHours Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Tested, Copilot comment addressed. Please approve @BenGWeeks |
There was a problem hiding this comment.
Pull request overview
Updates the timesheet time entry modal to support precise hour/minute entry (0–59 minutes) instead of 15-minute increments, aligning logged time with expected real-world durations and addressing #177.
Changes:
- Removed the 15-minute step restriction and increased Minutes max from 45 to 59.
- Improved edit-mode prefill by deriving hours/minutes from rounded total minutes to avoid the “60 minutes” rounding edge case.
- Added clamping in
onChangehandlers and in submit logic (hours 0–24, minutes 0–59; minutes forced to 0 when hours is 24).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const h = Math.floor(totalMinutes / 60); | ||
| const m = totalMinutes % 60; | ||
| setHours(h > 0 ? h.toString() : ''); | ||
| setMinutes(m > 0 ? m.toString() : ''); |
|
Do we still need this @EdiWeeks you think? Prefer to log time to the minute? Might be good for agents so very specific time (they might be very quick). Gneerally previously stuck to 0.25 increments so easier billing though. |
Summary
handleHoursChangehelper and improved empty-state display when editing entriesCloses #177
Test plan
🤖 Generated with Claude Code