Collect birth year instead of full date of birth #147

Closed
opened 2026-07-29 23:20:24 +00:00 by thatguygriff · 0 comments
Owner

Feedback

Change birth date to just birth year as part of registration

Current behaviour

A full Y-m-d date of birth is collected and stored in the us_date_of_birth user meta (src/Guardian/GuardianService.phpMETA_DOB, and the store/normalise helper around line 330). Rendered as <input type="date"> in templates/frontend/register-page.php (line 93) and templates/frontend/family-page.php (lines 45-46, 83), displayed in templates/admin/student-detail.php and templates/admin/students.php, and previewed in src/BlockPreview.php (line 194).

Wanted

Collect and display a birth year only — a 4-digit numeric input with a sane range.

Decisions to make

  • New meta key (e.g. us_birth_year) vs. reusing us_date_of_birth. A new key is cleaner; if so, decide whether existing DOB values get migrated to their year or just left in place.
  • Validation range (e.g. current year back to current year − 120).

Places to touch

  • src/Guardian/GuardianService.php — meta constant, normalisation, date_of_birth in the children list array
  • templates/frontend/register-page.php, templates/frontend/family-page.php
  • templates/admin/student-detail.php, templates/admin/students.php
  • src/BlockPreview.php
  • docs/features/parent-guardian-accounts.md, docs/features/account-registration.md
  • tests/Unit/Guardian/GuardianServiceTest.php, GuardianRepositoryTest.php, FamilyPageTest.php

Note

Stored in user meta, not a custom table — no Schema.php change and therefore no USC_VERSION bump needed. Confirm that when implementing.

## Feedback > Change birth date to just birth year as part of registration ## Current behaviour A full `Y-m-d` date of birth is collected and stored in the `us_date_of_birth` user meta (`src/Guardian/GuardianService.php` — `META_DOB`, and the store/normalise helper around line 330). Rendered as `<input type="date">` in `templates/frontend/register-page.php` (line 93) and `templates/frontend/family-page.php` (lines 45-46, 83), displayed in `templates/admin/student-detail.php` and `templates/admin/students.php`, and previewed in `src/BlockPreview.php` (line 194). ## Wanted Collect and display a birth **year** only — a 4-digit numeric input with a sane range. ## Decisions to make - New meta key (e.g. `us_birth_year`) vs. reusing `us_date_of_birth`. A new key is cleaner; if so, decide whether existing DOB values get migrated to their year or just left in place. - Validation range (e.g. current year back to current year − 120). ## Places to touch - `src/Guardian/GuardianService.php` — meta constant, normalisation, `date_of_birth` in the children list array - `templates/frontend/register-page.php`, `templates/frontend/family-page.php` - `templates/admin/student-detail.php`, `templates/admin/students.php` - `src/BlockPreview.php` - `docs/features/parent-guardian-accounts.md`, `docs/features/account-registration.md` - `tests/Unit/Guardian/GuardianServiceTest.php`, `GuardianRepositoryTest.php`, `FamilyPageTest.php` ## Note Stored in user meta, not a custom table — no `Schema.php` change and therefore no `USC_VERSION` bump needed. Confirm that when implementing.
thatguygriff added the enhancement label 2026-07-29 23:20:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#147