Calendar start year

I need to check that the user is over 18 years old on the calendar and I want the calendar to start 18 years before the current year. I could not find an answer to this question in the forum. how can I do it ? I will be glad if you help.

:one: This may help:

var today = new Date();
today.setFullYear(today.getFullYear() - 18);
var p_value = [new Date([today])];
var p_maxDate = [new Date([today])];

		inputEl: this.p_inputEl, // your calendar element
		dateFormat: 'dd/mm/yyyy',
		closeOnSelect: true,
		value: p_value,
		maxDate: p_maxDate,
		openIn: 'customModal'

:two: more here