Skip to content

Closes #128 - #129

Merged
LindseyB merged 2 commits into
mainfrom
fix-datetime-input-128
Jun 28, 2026
Merged

LindseyB merged 2 commits into
mainfrom
fix-datetime-input-128

Conversation

@LindseyB

Copy link
Copy Markdown
Owner

Closes #128

This pull request updates the date and time input fields to provide a more user-friendly and error-resistant experience by enforcing digit-only entry, auto-formatting, and improved accessibility hints. It also adds corresponding frontend tests to ensure these behaviors. The most important changes are:

Frontend JavaScript enhancements:

  • Refactored static/js/datetime-input.js to enforce digit-only input for date and time fields, automatically insert delimiters (e.g., dashes and colons) as the user types, clear the field on focus, and validate input strictly to canonical formats (YYYY-MM-DD for dates, HH:MM for times). [1] [2] [3] [4]

UI/UX improvements:

  • Updated field hints in templates/index.html to reflect the new digits-only input method and provide clear examples for users. [1] [2]

Automated testing:

  • Added new tests in tests/test_frontend.py to verify clear-on-focus behavior, digit-only restrictions, auto-delimiter insertion, and that the updated hints are present in the rendered HTML.

Copilot AI review requested due to automatic review settings June 28, 2026 05:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the requirements from #128 by making the custom birth date/time text inputs easier to type correctly: they clear on focus, accept digits only, auto-insert delimiters while typing, and validate to canonical formats on blur, with native picker fallback still available.

Changes:

  • Refactors static/js/datetime-input.js to enforce digit-only entry, auto-formatting, and strict blur validation for date/time.
  • Updates the UI hint text in templates/index.html to explain the digits-only entry method with examples.
  • Adds frontend-facing tests in tests/test_frontend.py to cover the new JS behaviors and template updates.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
static/js/datetime-input.js Adds digit-only input handling, auto-delimiter formatting, clear-on-focus, and strict normalization on blur.
templates/index.html Updates hint text to reflect digits-only typing workflow for date/time inputs.
tests/test_frontend.py Adds tests intended to validate the new JS behavior and updated UI hints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread static/js/datetime-input.js
Comment thread tests/test_frontend.py Outdated
Comment thread tests/test_frontend.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@LindseyB
LindseyB merged commit 2a3a3c7 into main Jun 28, 2026
2 checks passed
@LindseyB
LindseyB deleted the fix-datetime-input-128 branch June 28, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the birthday and time entry to be easier to use

2 participants