I need to apply my own style to my datpicker, but cannot decide how to add a custom class to the datepicker. I define my date selection as follows:
$("#From").datepicker({
showOn: 'button',
buttonImage: '/Content/images/icon-calendar.gif',
buttonImageOnly: true
}, $.datepicker.regional['en-GB']);
How to add custom class to datepicker div?
<div class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible MY_CLASS_GOES_HERE" id="ui-datepicker-div" style="position: absolute; top: 154px; left: 499px; z-index: 1; display: none;">
I know I can write:
$("#ui-datepicker-div).addClass("MY_CLASS_GOES_HERE")
.. but can I rely on datepicker always having the identifier "ui-datepicker-div" ?? Their more elegant way to do this?
Thanks in advance.
source
share