In the "Join SpikerSoft" registration stepper (basic-info-step), the Date of Birth field accepts free typing but does not auto-insert the / separators. A user typing 01011988 has to either manually type the slashes or use the calendar picker. We should auto-format as they type so 01011988 becomes 01/01/1988.
Proposed solution
Add a small reusable attribute directive (appDateInputMask) on the existing DOB <input> (which already has matDatepicker). On each input event it keeps only digits (cap 8) and formats progressively to MM/DD/YYYY, then re-emits a synthetic input event so MatDatepickerInput still parses the slash-delimited value into a Date. Re-emitting (rather than depending on listener order) keeps the parsed form value correct regardless of which input handler runs first.
Also add inputmode="numeric" for a better mobile keypad.
Why MM/DD/YYYY
The registration datePlaceholder is MM/DD/YYYY in both en and es (es = MM/DD/AAAA), and the native date adapter parses slash strings as MM/DD/YYYY regardless of locale, so a fixed MM/DD/YYYY mask matches the field's existing expectation in both languages. The calendar picker flow is unchanged.
Acceptance
Typing 01011988 shows 01/01/1988 and sets dateOfBirth to 1988-01-01.
Non-digits are ignored; input capped at 8 digits.
Calendar picker still works; existing age-gate/validation unaffected.
Frontend-only change (spikersoft-angular).
## Improvement
In the "Join SpikerSoft" registration stepper (`basic-info-step`), the Date of Birth field accepts free typing but does **not** auto-insert the `/` separators. A user typing `01011988` has to either manually type the slashes or use the calendar picker. We should auto-format as they type so `01011988` becomes `01/01/1988`.
## Proposed solution
Add a small reusable attribute directive (`appDateInputMask`) on the existing DOB `<input>` (which already has `matDatepicker`). On each `input` event it keeps only digits (cap 8) and formats progressively to `MM/DD/YYYY`, then re-emits a synthetic `input` event so `MatDatepickerInput` still parses the slash-delimited value into a `Date`. Re-emitting (rather than depending on listener order) keeps the parsed form value correct regardless of which `input` handler runs first.
Also add `inputmode="numeric"` for a better mobile keypad.
## Why MM/DD/YYYY
The registration `datePlaceholder` is `MM/DD/YYYY` in both `en` and `es` (es = `MM/DD/AAAA`), and the native date adapter parses slash strings as `MM/DD/YYYY` regardless of locale, so a fixed `MM/DD/YYYY` mask matches the field's existing expectation in both languages. The calendar picker flow is unchanged.
## Acceptance
- Typing `01011988` shows `01/01/1988` and sets `dateOfBirth` to 1988-01-01.
- Non-digits are ignored; input capped at 8 digits.
- Calendar picker still works; existing age-gate/validation unaffected.
- Frontend-only change (`spikersoft-angular`).
Resolved in spikersoft-angular PR #78 (merged to master). Added the reusable appDateInputMask directive on the registration DOB input so typing 01011988 auto-formats to 01/01/1988 while MatDatepickerInput still parses it to a Date; also added inputmode="numeric". Covered by directive unit tests + a basic-info-step integration test. Closing.
Resolved in spikersoft-angular PR #78 (merged to `master`). Added the reusable `appDateInputMask` directive on the registration DOB input so typing `01011988` auto-formats to `01/01/1988` while `MatDatepickerInput` still parses it to a `Date`; also added `inputmode="numeric"`. Covered by directive unit tests + a basic-info-step integration test. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Improvement
In the "Join SpikerSoft" registration stepper (
basic-info-step), the Date of Birth field accepts free typing but does not auto-insert the/separators. A user typing01011988has to either manually type the slashes or use the calendar picker. We should auto-format as they type so01011988becomes01/01/1988.Proposed solution
Add a small reusable attribute directive (
appDateInputMask) on the existing DOB<input>(which already hasmatDatepicker). On eachinputevent it keeps only digits (cap 8) and formats progressively toMM/DD/YYYY, then re-emits a syntheticinputevent soMatDatepickerInputstill parses the slash-delimited value into aDate. Re-emitting (rather than depending on listener order) keeps the parsed form value correct regardless of whichinputhandler runs first.Also add
inputmode="numeric"for a better mobile keypad.Why MM/DD/YYYY
The registration
datePlaceholderisMM/DD/YYYYin bothenandes(es =MM/DD/AAAA), and the native date adapter parses slash strings asMM/DD/YYYYregardless of locale, so a fixedMM/DD/YYYYmask matches the field's existing expectation in both languages. The calendar picker flow is unchanged.Acceptance
01011988shows01/01/1988and setsdateOfBirthto 1988-01-01.spikersoft-angular).Resolved in spikersoft-angular PR #78 (merged to
master). Added the reusableappDateInputMaskdirective on the registration DOB input so typing01011988auto-formats to01/01/1988whileMatDatepickerInputstill parses it to aDate; also addedinputmode="numeric". Covered by directive unit tests + a basic-info-step integration test. Closing.