feat(Forms): add `Field.DateOfBirth` for selecting date of birth
Thoughts:
- We should probably have a validator, that validates that the date is a valid date, and that it's not in the future? As I assume a date of birth can't be in the future
- Look into why Autocomplete always sets "off" for autoComplete property/attribute https://github.com/dnbexperience/eufemia/blob/main/packages/dnb-eufemia/src/components/autocomplete/Autocomplete.js#L1868 - https://github.com/dnbexperience/eufemia/pull/5022
Looking like this for now:
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| eufemia | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 3, 2025 1:32pm |
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Deploying eufemia with
Cloudflare Pages
| Latest commit: |
3d32c46
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0fadf990.eufemia-e25.pages.dev |
| Branch Preview URL: | https://feat-date-of-birth.eufemia-e25.pages.dev |
Day input field, which values are valid? Should just 1 be valid, or should we enforce 01?
It now auto correct during blur.
Add support for returnFormat, and dateFormat?
dateFormat is added. It does both. I don't think we should separate this for fields to avoid complexity.
Should onChange only return a value when a date is correctly entered, sort of the same as a [Field.Date](https://eufemia.dnb.no/uilib/extensions/forms/feature-fields/Date/)? But how will this affect the validator?
I think its good as it is for now.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete#bday-month must support autocomplete. Handle browser autofill/autocomplete for the month value which is in an autocomplete.
I could not find anyway to test this. We have at least added these.
How should the validator work? I find the logic challenging complex here compared to a regular input field. Now we have 3 that sort of should "work like one".
Seems to work fine to me now.
Thanks for the great commits 🤗
:tada: This PR is included in version 10.81.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: