Datepicker widget. How can I add some variable javascript code from my module to configure the date popup calendar? I need to personalize some settings in the date popup calendar in a date field.
This is the documentation for the popup calendar used in the Drupal date field:
http://api.jqueryui.com/datepicker/

I would to configure for example, the minDate property, to set a minimum selectable Date, according the documentation this is the code:

$( ".selector" ).datepicker({
  minDate: new Date(2007, 1 - 1, 1)
});


But... How and where do I type it in a custom module? It looks javascript, but I don't know how to make this code work for my date form element.
You can add it with #datepicker_options, e.g.:

$form['date'] = [
  '#type' =&gt; 'date_popup',
  // ...
  '#datepicker_options' =&gt; [
    'minDate' =&gt; 0,
  ],
];