feat(calendar): start-time + duration appointment form with all-day span (MAPPS-252) #275

Merged
vas2000-work merged 1 commit from feat/MAPPS-252-appointment-start-duration into main 2026-06-18 04:18:49 +02:00
Owner

Adopts a start-time + duration editing model in the appointment create/edit form (AppointmentFormModal, MAPPS-252): End is derived from Start plus a chosen duration instead of a second free datetime-local, so a new appointment defaults to a 60-minute span and shifting Start moves End by the same delta with the duration preserved. A Duration selector offers 15/30/45/60/90/120-minute presets (showing a read-only derived End in the browser's local zone) plus a Custom path that restores an explicit End picker and back-computes the duration. A new All-day toggle swaps the timed single-date editor for a multi-day Start-date/End-date span that sends whole-local-day start/end, and the chosen all_day is now sent on both create and update (replacing the hard-coded false). Client-only (no wire-model or server change); keeps the existing end < start guard; adds unit tests for the end computation, duration preservation, custom back-computation, and malformed input.

#MAPPS-252

Adopts a start-time + duration editing model in the appointment create/edit form (`AppointmentFormModal`, MAPPS-252): End is derived from Start plus a chosen duration instead of a second free `datetime-local`, so a new appointment defaults to a 60-minute span and shifting Start moves End by the same delta with the duration preserved. A Duration selector offers 15/30/45/60/90/120-minute presets (showing a read-only derived End in the browser's local zone) plus a Custom path that restores an explicit End picker and back-computes the duration. A new All-day toggle swaps the timed single-date editor for a multi-day Start-date/End-date span that sends whole-local-day start/end, and the chosen `all_day` is now sent on both create and update (replacing the hard-coded false). Client-only (no wire-model or server change); keeps the existing end < start guard; adds unit tests for the end computation, duration preservation, custom back-computation, and malformed input. #MAPPS-252
feat(calendar): adopt start-time plus duration model in appointment form
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 2m58s
Create release / Create release from merged PR (pull_request) Has been skipped
6f0d1e0031
Replace the appointment form's two independent start/end datetime-local inputs with a start-time + duration editing model so End is derived from Start plus a chosen duration, auto-shifts when Start moves with the duration intact, and defaults a new appointment to a 60-minute span without the user touching End (MAPPS-252, AppointmentFormModal in src/pages/calendar.rs).

Add a Duration Select offering 15/30/45/60/90/120-minute presets plus a Custom path; presets show a read-only derived End in the browser's local zone while Custom restores an explicit End datetime-local input and back-computes the duration so a later Start edit preserves the custom span.

Add an All day checkbox that swaps the timed single-date editor for a multi-day Start-date + (inclusive) End-date span; the all-day path sends start_time at local 00:00 of the start date and end_time at local 00:00 of the day after the end date so a single-day all-day event is a 24h span the grids already render.

Wire the chosen all_day value into both CreateAppointmentRequest.all_day and UpdateAppointmentRequest.all_day, replacing the hard-coded false / Some(false); keep the existing end_time < start_time guard as a defensive check for a non-positive custom duration.

Add helpers add_minutes_to_local, utc_to_date_value, parse_date_value, duration_options, and a DURATION_CUSTOM sentinel, plus duration_tests covering Start+duration end computation, duration preservation under Start shifts, custom back-computation, and malformed-input handling. Client-only: no changes to wire models or mokosh-server.

#MAPPS-252

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!275
No description provided.