This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
+++
title = "Submit form: date field should use type=date for calendar picker"
priority = 5
status = "done"
ticket_type = "bug"
dependencies = []
+++
## Bug
The date field on the submit form (`src/bin/ui/pages/submit.rs`, around line 200–215) uses `type="text"` with a placeholder hinting at YYYY-MM-DD format. This means:
- No calendar UI — users must type the date manually
- No browser-native date validation
- No consistent format enforcement
## Expected behaviour
The date field should use `type="date"`, which:
- Provides a browser-native calendar picker on supported browsers
- Automatically enforces valid date format
- Returns the value as a YYYY-MM-DD string, which matches the API's `date` field format — no conversion needed
## How to fix
In `src/bin/ui/pages/submit.rs`:
1. Change the `type` attribute on the date `<input>` from `"text"` to `"date"` (~line 204).
2. Remove or update the label text — it currently says `"Date (optional, YYYY-MM-DD)"`. With `type="date"`, the format hint is no longer needed. Change to `"Date (optional)"`.
3. Remove the `placeholder` attribute — `type="date"` inputs do not display placeholder text in most browsers; it is redundant.
4. The `oninput` handler reads `.value()` from the `HtmlInputElement`, which is already correct — `type="date"` returns the value in YYYY-MM-DD format, so no changes needed to data handling.
**Note:** The existing `HtmlInputElement` import is already correct. No new imports needed.