fix(projects): validate task due-date input and standardize change-history dates (PMS-317) #170

Merged
longjacksonle merged 1 commit from fix/PMS-317-task-date-validation-and-history-format into main 2026-06-16 00:13:43 +02:00

Implements PMS-317.

Problem

  1. The task Due Date field could submit a partial / invalid value (e.g. a month with no day/year).
  2. The change-history feed showed date values as raw yyyy-mm-dd (2026-03-01), not the app's standard Mar 1, 2026.

Changes (src/pages/projects.rs)

  • New validate_opt_date(raw, label): blank is allowed; a non-empty value must parse as %Y-%m-%d, else an inline error and no submit. Wired into both the create-task and edit-task save handlers for Due Date.
  • fmt_change_value (used by both the project and task change-history feeds) reformats a %Y-%m-%d string to %b %-d, %Y, matching fmt_date. Non-date values are unchanged.

Verification

just pre-commit (pinned rust 1.94 = CI) passes: fmt, clippy -D warnings, cargo check --target wasm32-unknown-unknown, all 91 lib tests.

Acceptance criteria

  • Incomplete / invalid due date shows an inline error and does not submit; valid saves; clearing still clears it.
  • Enforced on both create and edit task forms.
  • Project and task change-history date values render as Mar 1, 2026, not 2026-03-01.
  • Non-date history values unchanged.

🤖 Generated with Claude Code

Implements PMS-317. ## Problem 1. The task Due Date field could submit a partial / invalid value (e.g. a month with no day/year). 2. The change-history feed showed date values as raw `yyyy-mm-dd` (`2026-03-01`), not the app's standard `Mar 1, 2026`. ## Changes (`src/pages/projects.rs`) - New `validate_opt_date(raw, label)`: blank is allowed; a non-empty value must parse as `%Y-%m-%d`, else an inline error and no submit. Wired into both the create-task and edit-task save handlers for Due Date. - `fmt_change_value` (used by both the project and task change-history feeds) reformats a `%Y-%m-%d` string to `%b %-d, %Y`, matching `fmt_date`. Non-date values are unchanged. ## Verification `just pre-commit` (pinned rust 1.94 = CI) passes: fmt, clippy `-D warnings`, `cargo check --target wasm32-unknown-unknown`, all 91 lib tests. ## Acceptance criteria - [x] Incomplete / invalid due date shows an inline error and does not submit; valid saves; clearing still clears it. - [x] Enforced on both create and edit task forms. - [x] Project and task change-history date values render as `Mar 1, 2026`, not `2026-03-01`. - [x] Non-date history values unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(projects): validate task due-date input and standardize change-history dates (PMS-317)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m4s
Create release / Create release from merged PR (pull_request) Has been skipped
4409388977
Two date issues on the task forms / change history:

- The Due Date field could submit a partial / invalid value. Both the create-task and edit-task handlers now run validate_opt_date before submit: blank is allowed (clears the date), but a non-empty value must parse as a full yyyy-mm-dd calendar date or it shows an inline error and does not submit.
- The change-history feed printed date before/after values as raw yyyy-mm-dd. fmt_change_value (used by both the project and task history feeds) now reformats a yyyy-mm-dd string to "Mar 1, 2026", matching fmt_date and the rest of the app. Non-date values are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/PMS-317-task-date-validation-and-history-format 2026-06-16 00:13:43 +02:00
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!170
No description provided.