Title: JQuery UI DatePicker
Last modified: August 31, 2016

---

# JQuery UI DatePicker

 *  [George Sexton](https://wordpress.org/support/users/gsexton/)
 * (@gsexton)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/jquery-ui-datepicker/)
 * I’d like to use jQuery UI’s date picker. In my code, I have:
 *     ```
       public function getDatePicker($name,$id=null,$value=''){
       wp_enqueue_script('jquery-ui-datepicker');
       wp_enqueue_style('jquery-dp-style',"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css");
       }
       ```
   
 * I looked at the WordPress jQuery-ui.css file, and it doesn’t incldue any of the
   ui-datepicker definitions, so I added the remote style sheet. without the remote
   style sheet, the datepicker appears but is not correctly formatted.
 * and in my page javascript:
 *     ```
       if (typeof jQuery.datepicker == 'object') {
       jQuery('#idCDstarting_date, #idCDending_date, #idCDrecurrence_start, #idCDrecurrence_end').datepicker({"dateFormat": "yy-mm-dd"});
       }
       ```
   
 * I pretty much copied this from here:
 * [https://wordpress.org/support/topic/how-to-add-jquery-datepicker?replies=13](https://wordpress.org/support/topic/how-to-add-jquery-datepicker?replies=13)
 * This works. The datepicker displays as expected. However, if my page uses a jQuery
   dialog, the displayed jQuery dialog is messed up. I’ve seen this before with 
   another plugin that included it’s own jQuery UI css file. Specifically, the X
   icon appears twice and the content portion of the dialog is 10% of the width.
 * I tried getting just the datepicker.css from github and including it via wp_enqueue_style(),
   but it’s not quite right. The datepicker window is transparent and the navigation
   icons are missing, etc.
 * I guess my questions are:
 * Does anyone have any suggestions on how I can do this?
 * I’m super-confused why WordPress includes the jQuery UI datepicker code, but 
   doesn’t include the required CSS. Should I file a bug on this?

The topic ‘JQuery UI DatePicker’ is closed to new replies.

## Tags

 * [datepicker](https://wordpress.org/support/topic-tag/datepicker/)
 * [jQuery UI](https://wordpress.org/support/topic-tag/jquery-ui/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [George Sexton](https://wordpress.org/support/users/gsexton/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/jquery-ui-datepicker/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
