What is this?
Validate user's date of birth in relation to selected location using cookies.
npm i age-gate-location --save
;# sets age gate cookie name# sets days until cookie expiration# set path to local file that will populate select dropdown locations and respected legal age# get cookie value from cookie name set using agCookieName
# id 'ag-form' for age gate form# name 'ag-select' for locations select drop down# name 'ag-month'# name 'ag-day'# name 'ag-year'
Example 'locations.json' File Layout
Please advise that this package supports a JSON file structure of an array of objects with keys "short", "name", and "legalAge".
The first object in the array will ALWAYS be disabled and used as the pre-selected option of age gate on load.
Below is an example for Canada.
Below is an example using countries.