Datepicker not working in Wordpress administration
Hello, I am trying to include UI datepicker in a plugin of mine.
Datepicker behaves in a weird way; when the selected div is clicked,
it opens a calendar, but there is no css styling applied, and after
expanding it shrinks to its minimum width (that is, minimum for the
date numbers to fit in). I tried to apply some css styling, but it was
to no avail: datepicker expands, conforms to my styling, and then
shrinks to the minumum size.
This my php/html code:
function test_js() {
$jquery_UI_datepicker_path = get_bloginfo('url')."/wp-content/
plugins/event_scheduler/javascript/jquery-ui-
personalized-1.5.min.js";
?>
<script type="text/javascript" src="<?php echo
$jquery_UI_datepicker_path; ?>" ></script>
<script type="text/javascript">
$j=jQuery.noConflict();
$j(document).ready(function() {
$j('#event_date').datepicker();
//$j("div.debug").hide();
});
</script>
<?php
}
add_action('admin_head','test_js');
The last line includes the function in the wordpress header, after
jquery has been loaded.
Any suggestion?
Davide
PS: the datepicker theming docs ("http://docs.jquery.com/UI/Datepicker/
Theming") are incorrect. The divs and class names are all wrong:
"datepicker_div" is actually "ui-datepicker-div", etc.