Global

Methods

appendRegistration(registration) → {Object}

Append a validated registration to localStorage.
Parameters:
Name Type Description
registration Object Validated registration data.
Source:
Returns:
- Saved registration data.
Type
Object

buildValidDate(year, month, day) → {Date|null}

Build a date and ensure day/month/year are real.
Parameters:
Name Type Description
year Number Year component.
month Number Month component (1-12).
day Number Day component (1-31).
Source:
Returns:
- Date when valid, otherwise null.
Type
Date | null

calculateAge(birthDate) → {Number}

Calculate a person's age in years.
Parameters:
Name Type Description
birthDate Date The birth date of the person.
Source:
Returns:
- The age in years of the person.
Type
Number

calculateAge()

Source:

clearFormData()

Clear the form data object from localStorage.
Source:

getFormData() → {Object}

Get the form data object from localStorage.
Source:
Returns:
- The form data object.
Type
Object

getRegistrations() → {Array.<Object>}

Get registrations list from localStorage.
Source:
Returns:
- Registrations list.
Type
Array.<Object>

handleSubmit(e)

Handle the form submission event.
Parameters:
Name Type Description
e Event The form submission event.
Source:

handleSubmit()

Source:

isAdult(dateOfBirth) → {Boolean}

Check if the date of birth string is an adult.
Parameters:
Name Type Description
dateOfBirth Date The date of birth to check.
Source:
Returns:
- True if the date of birth string is an adult, false otherwise.
Type
Boolean

isFrenchCodePostal(codePostal) → {Boolean}

Check if the code postal is a valid French code postal.
Parameters:
Name Type Description
codePostal String The code postal string to check.
Source:
Returns:
- True if the code postal is a valid French code postal, false otherwise.
Type
Boolean

isFrenchCodePostal()

Source:

localStorage helpers()

Source:

parseDateOfBirth(rawDateOfBirth) → {Date|null}

Parse date of birth from supported formats: YYYY-MM-DD, YYYY/MM/DD, DD/MM/YYYY, DD-MM-YYYY.
Parameters:
Name Type Description
rawDateOfBirth String The date string to parse.
Source:
Returns:
- Parsed date if valid, otherwise null.
Type
Date | null

registrations localStorage helpers()

Source:

saveFormData(formData)

Save the form data object to localStorage.
Parameters:
Name Type Description
formData Object The form data object to save.
Source:

saveRegistrations(registrations)

Save registrations list to localStorage.
Parameters:
Name Type Description
registrations Array.<Object> Registrations list.
Source:

validateCodePostal(codePostal) → {String}

Validate the code postal string.
Parameters:
Name Type Description
codePostal String The code postal string to validate.
Source:
Returns:
- The validated code postal string.
Type
String

validateCodePostal()

Source:

validateDateOfBirth(dateOfBirth) → {String}

Validate the date of birth string.
Parameters:
Name Type Description
dateOfBirth String The date of birth string to validate.
Source:
Returns:
- The validated date of birth string.
Type
String

validateDateOfBirth()

Source:

validateEmail(email) → {String}

Validate the email string.
Parameters:
Name Type Description
email String The email string to validate.
Source:
Returns:
- The validated email string.
Type
String

validateEmail()

Source:

validateFormData(formData) → {Object}

Validate the form data object.
Parameters:
Name Type Description
formData FormData The form data object to validate.
Source:
Returns:
- The validated form data object.
Type
Object

validateFormData()

Source:

validateName(name) → {String}

Validate the name string.
Parameters:
Name Type Description
name String The name string to validate.
Source:
Returns:
- The validated name string.
Type
String

validateName()

Source:

validatePrenom(prenom) → {String}

Validate the prenom string.
Parameters:
Name Type Description
prenom String The prenom string to validate.
Source:
Returns:
- The validated prenom string.
Type
String

validatePrenom()

Source:

validateVille(ville) → {String}

Validate the ville string.
Parameters:
Name Type Description
ville String The ville string to validate.
Source:
Returns:
- The validated ville string.
Type
String

validateVille()

Source: