Needs work
Project:
Date
Version:
7.x-2.x-dev
Component:
Date Popup
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2013 at 10:53 UTC
Updated:
23 Jan 2013 at 10:53 UTC
Coming from #507502-33: (needs documentation) Provide Locale support for jQuery UI, instead of patching core, I did this:
/**
* Implementation of hook_library_alter()
*
* Support localized date picker. See drupal.org/node/507502#comment-4534106.
*/
function my_module_library_alter(&$libraries, $module) {
global $language;
if ($module == 'system' && isset($libraries['ui.datepicker'])) {
$datepicker = drupal_get_path('module', 'locale') . '/locale.datepicker.js';
$libraries['ui.datepicker']['js'][$datepicker] = array('scope' => 'footer', 'group' => JS_THEME);
$libraries['ui.datepicker']['js'][] = array(
'data' => array(
'jqueryuidatepicker' => array(
'rtl' => $language->direction == LANGUAGE_RTL,
'firstDay' => variable_get('date_first_day', 0),
),
),
'type' => 'setting',
);
}
}
This could probably be tweaked to less intrusive, but until that D7 patch lands, I thought maybe others could use this option.