Answer has already been given, but I'd like to extend it a bit to include CSS (Wordpress doesn't provide stylesheets for jQuery UI), to help anyone passing trying to use this kind of scripts.
Basically (and very simply), you need to have at least these three lines of code:
wp_enqueue_script('jquery-ui-datepicker');
wp_register_style('jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css');
wp_enqueue_style('jquery-ui');
Explanation line by line:
- Load jQuery UI Datepicker (library already registered by Wordpress, nothing else is necessary)
- Register Stylesheet with handle
jquery-ui
(I used the one hosted by Google, you can use whichever you prefer) - Effectively include stylesheet into the ones loaded by Wordpress in this page
And now your Datepickers will all be nice and colourful! :)
HTML5 gift
This is not what the OP was asking for, but it's somewhat related to the question: if you don't want to bother adding the Datepicker, you could try the HTML5 date
input type, letting the browser create a very nice (and default) datepicker:
<input type="date" name="the_date" />
Yes, nothing else is needed (and it works in the back-end of Wordpress, too: https://jsfiddle.net/2jxdvea0/
More info on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
Note As @mark pointed out, the input does not work for Firefox (as well as for other browsers). This is noted in the MDN page, but of course it should be mentioned here as well. There are, of course, workarounds to this problem, but it would be beyond the sake of this question to write about them.
Update 03-11-2017 As of @kosso's comment, Firefox support for this is coming in version 57