Datepicker widget. How can I add some variable javascript code from my module to configure the date popup calendar?
You can add it with #datepicker_options, e.g.:

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