Repository navigation
Closes #128 - #129
Merged
Merged
Closes #128#129
Conversation
Contributor
There was a problem hiding this comment.
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.jsto enforce digit-only entry, auto-formatting, and strict blur validation for date/time. - Updates the UI hint text in
templates/index.htmlto explain the digits-only entry method with examples. - Adds frontend-facing tests in
tests/test_frontend.pyto 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
static/js/datetime-input.jsto 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-DDfor dates,HH:MMfor times). [1] [2] [3] [4]UI/UX improvements:
templates/index.htmlto reflect the new digits-only input method and provide clear examples for users. [1] [2]Automated testing:
tests/test_frontend.pyto verify clear-on-focus behavior, digit-only restrictions, auto-delimiter insertion, and that the updated hints are present in the rendered HTML.