# Global

##

### Methods

#### appendRegistration(registration) → {Object}

Append a validated registration to localStorage.

##### Parameters:

Name | Type | Description
--- | --- | ---
`registration` | Object | Validated registration data.

Source:
  - module.js, line 334

##### 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:
  - module.js, line 224

##### 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:
  - module.js, line 11

##### Returns:

- The age in years of the person.

Type
  Number

#### calculateAge()

Source:
  - module.test.js, line 9

#### clearFormData()

Clear the form data object from localStorage.

Source:
  - module.js, line 290

#### getFormData() → {Object}

Get the form data object from localStorage.

Source:
  - module.js, line 275

##### Returns:

- The form data object.

Type
  Object

#### getRegistrations() → {Array.<Object>}

Get registrations list from localStorage.

Source:
  - module.js, line 312

##### Returns:

- Registrations list.

Type
  Array.<Object>

#### handleSubmit(e)

Handle the form submission event.

##### Parameters:

Name | Type | Description
--- | --- | ---
`e` | Event | The form submission event.

Source:
  - module.js, line 346

#### handleSubmit()

Source:
  - module.test.js, line 441

#### 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:
  - module.js, line 180

##### Returns:

- True if the date of birth string is an adult, false otherwise.

Type
  Boolean

#### isAdult()

Source:
  - module.test.js, line 321

#### 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:
  - module.js, line 242

##### Returns:

- True if the code postal is a valid French code postal, false otherwise.

Type
  Boolean

#### isFrenchCodePostal()

Source:
  - module.test.js, line 339

#### localStorage helpers()

Source:
  - module.test.js, line 356

#### 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:
  - module.js, line 192

##### Returns:

- Parsed date if valid, otherwise null.

Type
  Date | null

#### registrations localStorage helpers()

Source:
  - module.test.js, line 396

#### saveFormData(formData)

Save the form data object to localStorage.

##### Parameters:

Name | Type | Description
--- | --- | ---
`formData` | Object | The form data object to save.

Source:
  - module.js, line 262

#### saveRegistrations(registrations)

Save registrations list to localStorage.

##### Parameters:

Name | Type | Description
--- | --- | ---
`registrations` | Array.<Object> | Registrations list.

Source:
  - module.js, line 299

#### validateCodePostal(codePostal) → {String}

Validate the code postal string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`codePostal` | String | The code postal string to validate.

Source:
  - module.js, line 136

##### Returns:

- The validated code postal string.

Type
  String

#### validateCodePostal()

Source:
  - module.test.js, line 215

#### validateDateOfBirth(dateOfBirth) → {String}

Validate the date of birth string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dateOfBirth` | String | The date of birth string to validate.

Source:
  - module.js, line 92

##### Returns:

- The validated date of birth string.

Type
  String

#### validateDateOfBirth()

Source:
  - module.test.js, line 141

#### validateEmail(email) → {String}

Validate the email string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`email` | String | The email string to validate.

Source:
  - module.js, line 72

##### Returns:

- The validated email string.

Type
  String

#### validateEmail()

Source:
  - module.test.js, line 116

#### validateFormData(formData) → {Object}

Validate the form data object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`formData` | FormData | The form data object to validate.

Source:
  - module.js, line 156

##### Returns:

- The validated form data object.

Type
  Object

#### validateFormData()

Source:
  - module.test.js, line 268

#### validateName(name) → {String}

Validate the name string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | The name string to validate.

Source:
  - module.js, line 32

##### Returns:

- The validated name string.

Type
  String

#### validateName()

Source:
  - module.test.js, line 42

#### validatePrenom(prenom) → {String}

Validate the prenom string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`prenom` | String | The prenom string to validate.

Source:
  - module.js, line 52

##### Returns:

- The validated prenom string.

Type
  String

#### validatePrenom()

Source:
  - module.test.js, line 83

#### validateVille(ville) → {String}

Validate the ville string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ville` | String | The ville string to validate.

Source:
  - module.js, line 116

##### Returns:

- The validated ville string.

Type
  String

#### validateVille()

Source:
  - module.test.js, line 190