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({
18 closeText: Drupal.t('Done'),
19 prevText: Drupal.t('Prev'),
20 nextText: Drupal.t('Next'),
21 currentText: Drupal.t('Today'),
23 Drupal.t('January', {}, { context: 'Long month name' }),
24 Drupal.t('February', {}, { context: 'Long month name' }),
25 Drupal.t('March', {}, { context: 'Long month name' }),
26 Drupal.t('April', {}, { context: 'Long month name' }),
27 Drupal.t('May', {}, { context: 'Long month name' }),
28 Drupal.t('June', {}, { context: 'Long month name' }),
29 Drupal.t('July', {}, { context: 'Long month name' }),
30 Drupal.t('August', {}, { context: 'Long month name' }),
31 Drupal.t('September', {}, { context: 'Long month name' }),
32 Drupal.t('October', {}, { context: 'Long month name' }),
33 Drupal.t('November', {}, { context: 'Long month name' }),
34 Drupal.t('December', {}, { context: 'Long month name' }),
54 Drupal.t('Wednesday'),
77 dateFormat: Drupal.t('mm/dd/yy'),
80 }, drupalSettings.jquery.ui.datepicker);
81 $.datepicker.setDefaults($.datepicker.regional['drupal-locale']);
84 }(jQuery, Drupal, drupalSettings));