Using:
jquery_update 6.x-2.x-dev (jquery 1.3)
jquery_ui 6.x-1.x-dev (jqueryui 1.7.2)

Also happened with:
jquery_update 6.x-1.1 (jquery 1.2)
jquery_ui 6.x-1.3 (jqueryui 1.6?)

The date picker popup doesn't look for an applied jqueryui theme, as far as I can tell, but it does attempt load files if the jquery_ui module exists (in the date_popup_load() function). This can result in unexpected theming of the datepicker. A bit of cooperation with jquery_ui could fix this up.

In query_ui #388384: Allow usage of jQuery UI themes from the themeroller, there is some activity towards exposing jquery ui themes to the rest of the system. With that patch applied (as well as jquery_ui #578402: Call to absent js script for a somewhat related issue), date_popup.module can be modified to show a fully jquery-UI themed datepicker. Here are the changes I made:

date_popup_init(): The css should depend upon whether a jquery UI theme is present, rather than always using the module css.
//drupal_add_css(drupal_get_path('module', 'date_popup') .'/themes/datepicker.css');

date_popup_load(): Since the jquery_ui module test is here, set the css here.

  if (module_exists('jquery_ui')) {
    $css = variable_get('jquery_ui_theme', '') ?
      drupal_get_path('module', 'jquery_ui')  .'/jquery.ui/'. variable_get('jquery_ui_theme', 'base') :
      drupal_get_path('module', 'date_popop')  .'/themes/datepicker.css';
    drupal_add_css($css);
    jquery_ui_add('ui.datepicker');
  }
  else {
    drupal_add_css(drupal_get_path('module', 'date_popup')  .'/themes/datepicker.css');
    drupal_add_js($path .'/lib/ui.datepicker.js');
  }

The jquery_ui_theme variable is part of #388384: Allow usage of jQuery UI themes from the themeroller.

I've not supplied a proper patch since I suspect there may be other considerations if trying to get all three of these (my code above and the 2 jquery_ui patches) integrated across both modules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicholasThompson’s picture

Title: Date popup module fails to load jquery ui theme » Date popup integration with JQuery UI Themeroller
Version: 6.x-2.4 » 6.x-2.x-dev
Category: feature » bug
Status: Active » Needs review
FileSize
358 bytes

I applied the patch from #30 in #388384: Allow usage of jQuery UI themes from the themeroller. This allows JQueryUI to pickup on custom themes and appears to work perfectly.

I only had to make one small change to date_popup.module... In date_popup_init, I had to add

  if (module_exists('jquery_ui')) return;

This was to stop the popup module inserting its own CSS which broke the themeroller's css.

That's all I needed to do...

b0r7’s picture

just applied the patch, works great.. thx

Fabianx’s picture

Status: Needs review » Closed (won't fix)

There is an easier way:

In you theme .info file do:

stylesheets[all][] = datepicker.css

and add an empty datepicker.css to your theme.

Then clear theme cache.

As this can be done via theming, I consider this a "won't fix".

Best Wishes,

Fabian (LionsAd)

mansspams’s picture

Status: Closed (won't fix) » Active

Fabianx, empty datepicker.css does not work. Only removing themes from date_popup helped.

Fabianx’s picture

Status: Active » Closed (won't fix)

LavaMeTender ak,

This solution does work for me. I have the solution running perfectly on a production site.

Steps to do:

1) Edit your theme .info file and add

stylesheets[all][] = datepicker.css

2) Add an empty datepicker.css to the root of your theme.

3) Clear your theme cache.

kenorb’s picture

Status: Closed (won't fix) » Active

The same problem, I can't use datepicker with date_popup module enabled, because of the theme conflict.
I had to disable date_popup module.
Any solution available?

fugazi’s picture

same probleme

jiv_e’s picture

Status: Active » Closed (won't fix)

This issue is getting old with no activity. I'm cleaning the issue queue, so I'll close this. Please feel free to reopen if needed!