Here is @B2F's great & correct answer in complete(ish) module form:
better_datepicker/better_datepicker.info.yml
name: 'Better Datepicker'
type: module
description: 'select year and month on datetime fields'
package: "Date"
core: 8.x
#CSS & JS
libraries:
- 'better_datepicker/better-datepicker'
better_datepicker/better_datepicker.libraries.yml
better-datepicker:
version: 1.x
js:
js/better-datepicker.js: {}
dependencies:
- core/jquery
#- core/drupalSettings
better_datepicker/better_datepicker.module
<?php
function better_datepicker_element_info_alter(array &$types) {
if (isset($types['datetime'])) {
$types['datetime']['#attached']['library'][] = 'better_datepicker/better-datepicker';
}
}
better_datepicker/js/better-datepicker.js
(function ($) {
Drupal.behaviors.alterDatePicker = {
attach: function (context, settings) {
$.datepicker._defaults.changeMonth = true;
$.datepicker._defaults.changeYear = true;
// adjust year range
$.datepicker._defaults.yearRange = "c-80:c+10";
}
};
})(jQuery);