summaryrefslogtreecommitdiff
path: root/modules/locale/locale.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/locale/locale.module')
-rw-r--r--modules/locale/locale.module21
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 029492091..a20f3d5d7 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -950,15 +950,22 @@ function locale_css_alter(&$css) {
* Provides the language support for the jQuery UI Date Picker.
*/
function locale_library_alter(&$libraries, $module) {
- global $language;
- if ($module == 'system' && isset($libraries['system']['ui.datepicker'])) {
+ if ($module == 'system' && isset($libraries['ui.datepicker'])) {
+ global $language;
+ // locale.datepicker.js should be added in the JS_LIBRARY group, so that
+ // this attach behavior will execute early. JS_LIBRARY is the default for
+ // hook_library_info_alter(), thus does not have to be specified explicitly.
$datepicker = drupal_get_path('module', 'locale') . '/locale.datepicker.js';
- $libraries['system']['ui.datepicker']['js'][$datepicker] = array('group' => JS_THEME);
- $libraries['system']['ui.datepicker']['js'][] = array(
+ $libraries['ui.datepicker']['js'][$datepicker] = array();
+ $libraries['ui.datepicker']['js'][] = array(
'data' => array(
- 'jqueryuidatepicker' => array(
- 'rtl' => $language->direction == LANGUAGE_RTL,
- 'firstDay' => variable_get('date_first_day', 0),
+ 'jquery' => array(
+ 'ui' => array(
+ 'datepicker' => array(
+ 'isRTL' => $language->direction == LANGUAGE_RTL,
+ 'firstDay' => variable_get('date_first_day', 0),
+ ),
+ ),
),
),
'type' => 'setting',