commit 0f683a96c79ecc2b74d35e5bde19fdf30cf731e7
parent 5da0e70087fffb9c61630b42b96ef64e100a3906
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Thu, 13 Apr 2023 21:18:08 +0200
feat(athletes): use html date picker
Diffstat:
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/Athletes.js b/src/Athletes.js
@@ -44,12 +44,6 @@ function defaultsSet({nr, firstname, lastname, birthday, school}) {
)
}
-function validateBirthday(e) {
- if (e.target.validity.patternMismatch) {
- e.target.value = e.target.defaultValue
- }
-}
-
async function deleteAthlete(e, athleteId, athleteFirstName, athleteLastName) {
e.preventDefault()
@@ -118,11 +112,8 @@ function AthleteForm({session}) {
</td>
<td className='right'>
<input
- type='text'
- name='birthday'
- defaultValue='0000-00-00'
- pattern='(\d{4}-\d{2}-\d{2})*'
- onBlur={(e) => validateBirthday(e)} />
+ type='date'
+ name='birthday' />
</td>
<td>
<input type='text' name='school' defaultValue='School/team' />