3 * Datepicker JavaScript for the Locale module.
6 (function($, Drupal, drupalSettings) {
8 * Attaches language support to the jQuery UI datepicker component.
10 * @type {Drupal~behavior}
12 Drupal.behaviors.localeDatepicker = {
13 attach(context, settings) {
14 // This code accesses drupalSettings and localized strings via Drupal.t().
15 // So this code should run after these are initialized. By placing it in an
16 // attach behavior this is assured.
17 $.datepicker.regional['drupal-locale'] = $.extend(
19 closeText: Drupal.t('Done'),
20 prevText: Drupal.t('Prev'),
21 nextText: Drupal.t('Next'),
22 currentText: Drupal.t('Today'),
24 Drupal.t('January', {}, { context: 'Long month name' }),
25 Drupal.t('February', {}, { context: 'Long month name' }),
26 Drupal.t('March', {}, { context: 'Long month name' }),
27 Drupal.t('April', {}, { context: 'Long month name' }),
28 Drupal.t('May', {}, { context: 'Long month name' }),
29 Drupal.t('June', {}, { context: 'Long month name' }),
30 Drupal.t('July', {}, { context: 'Long month name' }),
31 Drupal.t('August', {}, { context: 'Long month name' }),
32 Drupal.t('September', {}, { context: 'Long month name' }),
33 Drupal.t('October', {}, { context: 'Long month name' }),
34 Drupal.t('November', {}, { context: 'Long month name' }),
35 Drupal.t('December', {}, { context: 'Long month name' }),
55 Drupal.t('Wednesday'),
78 dateFormat: Drupal.t('mm/dd/yy'),
82 drupalSettings.jquery.ui.datepicker,
84 $.datepicker.setDefaults($.datepicker.regional['drupal-locale']);
87 })(jQuery, Drupal, drupalSettings);